diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-04-28 16:17:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-28 16:17:54 +0200 |
commit | 9d1869d98e23162f5bbeffe95c1973e42f2b89d9 (patch) | |
tree | 9fc3fb1291ebb66686d7011c9cbf339bd9f3ce04 /application/palemoon/components/downloads/content/indicator.js | |
parent | 8d6b34f8630d6802e3570e8c6adcd2ad6fe4ddbe (diff) | |
parent | c99c89cb40123d9b37f0e75a9fde6141295acca9 (diff) | |
download | UXP-9d1869d98e23162f5bbeffe95c1973e42f2b89d9.tar UXP-9d1869d98e23162f5bbeffe95c1973e42f2b89d9.tar.gz UXP-9d1869d98e23162f5bbeffe95c1973e42f2b89d9.tar.lz UXP-9d1869d98e23162f5bbeffe95c1973e42f2b89d9.tar.xz UXP-9d1869d98e23162f5bbeffe95c1973e42f2b89d9.zip |
Merge pull request #276 from janekptacijarabaci/pm_url_1
[PALEMOON] [frontend vs backend] Change a function "getShortcutOrURI" to "getShortcutOrURIAndPostData", fix Drag & Drop and a function "Copy Download Link"
Diffstat (limited to 'application/palemoon/components/downloads/content/indicator.js')
-rw-r--r-- | application/palemoon/components/downloads/content/indicator.js | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/application/palemoon/components/downloads/content/indicator.js b/application/palemoon/components/downloads/content/indicator.js index e6a5bd012..1a2175a92 100644 --- a/application/palemoon/components/downloads/content/indicator.js +++ b/application/palemoon/components/downloads/content/indicator.js @@ -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(); } }, |