fix(StatusChatInput): handle non standard DND MIME types
- most browsers will pass a standard `text/uri-list` MIME type, however Chrome uses `text/x-moz-url` so we handle that separately (`drop.hasUrls` is `false` in this case)
This commit is contained in:
parent
ebbd259754
commit
4bf09e2b84
|
@ -943,7 +943,15 @@ Rectangle {
|
|||
target: Global.dragArea
|
||||
ignoreUnknownSignals: true
|
||||
function onDroppedOnValidScreen(drop) {
|
||||
if (validateImagesAndShowImageArea(drop.urls)) {
|
||||
let dropUrls = drop.urls
|
||||
if (!drop.hasUrls) {
|
||||
console.warn("Trying to drop, list of URLs is empty tho; formats:", drop.formats)
|
||||
if (drop.formats.includes("text/x-moz-url")) { // Chrome uses a non-standard MIME type
|
||||
dropUrls = drop.getDataAsString("text/x-moz-url")
|
||||
}
|
||||
}
|
||||
|
||||
if (validateImagesAndShowImageArea(dropUrls)) {
|
||||
drop.acceptProposedAction()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue