handle chrome->firefox

This commit is contained in:
bymyself
2025-06-01 07:38:40 -07:00
parent 27eb7cade4
commit 14f0f0f3cb

View File

@@ -468,6 +468,19 @@ export class ComfyApp {
event.dataTransfer
)
await this.handleFile(resolvedFile)
} else {
// Try loading the first URI in the transfer list (handles Chrome->Firefox BMP case)
const validTypes = ['text/uri-list', 'text/x-moz-url']
const match = [...event.dataTransfer.types].find((t) =>
validTypes.find((v) => t === v)
)
if (match) {
const uri = event.dataTransfer.getData(match)?.split('\n')?.[0]
if (uri) {
const blob = await (await fetch(uri)).blob()
await this.handleFile(new File([blob], uri, { type: blob.type }))
}
}
}
} catch (err: any) {
useToastStore().addAlert(