Closed Bug 1379960 Opened 7 years ago Closed 6 years ago

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

Categories

(WebExtensions :: Untriaged, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1423168

People

(Reporter: jwkbugzilla, Unassigned)

References

Details

Attachments

(1 file)

639 bytes, application/x-xpinstall
Details
Attached file 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 https://developer.mozilla.org/en/docs/Web/HTML/Element/a#attr-download, 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.
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.
Flags: needinfo?(amckay)
See Also: → 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.
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.
I have the same issue at one of my profiles, but didn't on the other. What made the difference, having lastpass installed. Weird fix...

To see it in action:

1. install lastpass (probably another extension would also work, I just don't know which one)
2. restart firefox when it is asking for it
3. the download attribute isn't ignored anymore

This 'fix' worked within FF ESR and FF 55.0.3, couldn't test in nightly because legacy addons are disabled
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Is this really a dupe of bug 1420419?  data: URLs have no concept of "revocation" unlike blob: URLs.
Flags: needinfo?(mixedpuppy)
emk: you may be right and I jumped the gun, I'll undo for now.
Status: RESOLVED → REOPENED
Flags: needinfo?(mixedpuppy)
Resolution: DUPLICATE → ---
Product: Toolkit → WebExtensions
Status: REOPENED → RESOLVED
Closed: 7 years ago6 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: