Bug 92737 - Part 8: Download multiple files when multiple items are dropped on Downloads button

Issue #121
This commit is contained in:
janekptacijarabaci 2018-04-15 11:49:38 +02:00 committed by Roy Tam
commit bafa57d4d6

View file

@ -548,15 +548,18 @@ const DownloadsIndicatorView = {
if (dt.mozGetDataAt("application/x-moz-file", 0))
return;
let name = {};
let url = browserDragAndDrop.drop(aEvent, name);
if (url) {
if (url.startsWith("about:")) {
return;
}
let sourceDoc = dt.mozSourceNode ? dt.mozSourceNode.ownerDocument : document;
saveURL(url, name.value, null, true, true, null, sourceDoc);
let links = browserDragAndDrop.dropLinks(aEvent);
if (!links.length)
return;
let sourceDoc = dt.mozSourceNode ? dt.mozSourceNode.ownerDocument : document;
let handled = false;
for (let link of links) {
if (link.url.startsWith("about:"))
continue;
saveURL(link.url, link.name, null, true, true, null, sourceDoc);
handled = true;
}
if (handled) {
aEvent.preventDefault();
}
},