Open
Bug 1237226
Opened 8 years ago
Updated 2 years ago
target attribute is ignored with an anchor with download attribute even if the download is overridden by explicit Content-Disposition from the server
Categories
(Core :: DOM: Navigation, defect)
Tracking
()
UNCONFIRMED
People
(Reporter: megaman, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36 Steps to reproduce: create a link: <a target="_blank" download="test.txt" href="/cgi-bin/test"> /cgi-bin/test contains a web page with HTTP header "Content-Disposition: inline". Actual results: the content of /cgi-bin/test will replace the source page. Expected results: the content of /cgi-bin/test should be opened in a new window
Updated•8 years ago
|
Component: Untriaged → Document Navigation
Product: Firefox → Core
Comment 1•8 years ago
|
||
We explicitly ignore the target attribute when the download attribute is supplied. Tom, why do we do that, exactly? You have blame for that code, and there is no clear explanation of why it's done. Given that, the problem here is that the explicit Content-Disposition header then overrides the download attribute, so the download doesn't actually happen. That's something else we've considered changing.
Flags: needinfo?(evilpies)
Updated•8 years ago
|
Summary: target attribute notwork with an anchor with download attribute → target attribute is ignored with an anchor with download attribute even if the download is overridden by explicit Content-Disposition from the server
Comment 2•8 years ago
|
||
(In reply to Boris Zbarsky [:bz] (Vacation until Jan 4) from comment #1) > We explicitly ignore the target attribute when the download attribute is > supplied. Tom, why do we do that, exactly? You have blame for that code, > and there is no clear explanation of why it's done. > Not sure about that, where does that happen? I have no idea at the moment. > Given that, the problem here is that the explicit Content-Disposition header > then overrides the download attribute, so the download doesn't actually > happen. That's something else we've considered changing. Yeah. Right now we only allow same-origin downloads anyway, so overriding what the server asks for might just be fine. I think this was discussed before.
Flags: needinfo?(evilpies)
Comment 3•8 years ago
|
||
> Not sure about that, where does that happen? http://hg.mozilla.org/mozilla-central/annotate/e0bcd16e1d4b/dom/base/nsContentUtils.cpp#l4877
Comment 4•8 years ago
|
||
Can confirm this also happens on FF 45 on MacOS X 10.10.
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•