download attribute is ignored for extension pages linking to data: URLs




WebExtensions: Untriaged
16 days ago
6 days ago


(Reporter: Wladimir Palant, Unassigned)



Firefox Tracking Flags

(Not tracked)



(1 attachment)

639 bytes, application/x-xpinstall


16 days ago
Created attachment 8885231 [details]
Test extension

Steps to reproduce:

1. Go to about:debugging and install the attached test extension as a temporary add-on.
2. Go to about:addons, find "WebExtensions test" in the list and click Preferences.
3. Click "Click here to download some data" link on the options page (linking to a data: URL, with download attribute set).

Expected results:

Firefox offers to download the data, which is what I see when opening the same page from a file:/// URL.

Actual results:

Firefox opens the URL in the browser. I've tested in Firefox 56.0a1 nightly (2017-07-11) on Ubuntu.

Note that, according to, the download attribute is only respected for same-origin URLs. However, blob: and data: URLs are explicitly considered same-origin here so this shouldn't prevent showing the download prompt. I assume that the same issue exists for blob: URL but cannot test due to bug 1379954.

Comment 1

16 days ago
Placing the link inside an about:blank frame within the extension page allows working around this issue, downloading works for both data: and blob: URLs then.


7 days ago
Flags: needinfo?(amckay)
See Also: → bug 1331176
There's a dupe somewhere I'm sure, but I can't find it.
Flags: needinfo?(amckay)
Priority: -- → P3
(In reply to Andy McKay [:andym] from comment #2)
> There's a dupe somewhere I'm sure, but I can't find it.

I'm pretty sure it's bug 1331176, I just haven't looked in detail yet.

Comment 4

6 days ago
Bug 1331176 was fixed in nightly as of 2017-06-30, the bug I filed here was reproduced in 2017-07-11. Related - quite likely. Duplicate - no, definitely not.
You need to log in before you can comment on or make changes to this bug.