Chromium now follows Firefox's policy on the download attribute.

This commit is contained in:
ccd0 2014-06-12 09:58:02 -07:00
parent ce6e6b52f5
commit 45d4d2241b

View File

@ -6,9 +6,7 @@ DownloadLink =
className: 'download-link' className: 'download-link'
textContent: 'Download file' textContent: 'Download file'
<% if (type === 'userscript') { %> # Specifying the filename with the download attribute only works for same-origin links.
unless chrome?
# Firefox places same-origin restrictions on links with the download attribute.
$.on a, 'click', (e) -> $.on a, 'click', (e) ->
return true if @protocol is 'blob:' return true if @protocol is 'blob:'
e.preventDefault() e.preventDefault()
@ -18,7 +16,6 @@ DownloadLink =
@click() @click()
else else
new Notice 'error', "Could not download #{file.URL}", 30 new Notice 'error', "Could not download #{file.URL}", 30
<% } %>
$.event 'AddMenuEntry', $.event 'AddMenuEntry',
type: 'post' type: 'post'