PDF.js ignores content-disposition filename
Categories
(Firefox :: PDF Viewer, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox88 | --- | verified |
People
(Reporter: naaoffupzhgyjmssxg, Assigned: Snuffleupagus)
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0
Steps to reproduce:
-
Open a pdf in firefox without filename in url:
https://www.maricopa.gov/DocumentCenter/View/6802/Get-Adobe-Reader-PDF?bidId= -
Save the pdf or look at document info
Actual results:
PDF.js return "document.pdf" as filename because there is something wrong with getMetadata() and saveDocument() defined here: https://github.com/mozilla/pdf.js/blob/2194fb940dac25b3da799474a1e2a9ceb63ab18a/src/display/api.js .
Expected results:
PDF.js should return "Get Adobe Reader.pdf" as filename but for some reason it fails.
Comment 1•4 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox::PDF Viewer' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Assignee | ||
Comment 2•4 years ago
|
||
Please note: This will require https://github.com/mozilla/pdf.js/pull/13014 landing first.
Updated•4 years ago
|
Comment 3•4 years ago
|
||
This works for me in Firefox 86 release and latest Nightly 88.0a1 under Win 10 64-bit, so I believe it was fixed by the patch mentioned in comment 2.
Ekeek , is this still reproducible for you? Thank you!
Assignee | ||
Comment 4•4 years ago
|
||
(In reply to Petruta Horea [:phorea] from comment #3)
This works for me in Firefox 86 release and latest Nightly 88.0a1 under Win 10 64-bit
Not if you use the Ctrl
+S
shortcut (however it works with the "download" button on the PDF Viewer toolbar).
I believe it was fixed by the patch mentioned in comment 2.
Huh, but that patch hasn't actually landed yet (nor the necessary upstream change).
Comment 5•4 years ago
|
||
(In reply to Jonas Jenwald [:Snuffleupagus] from comment #4)
I was indeed using the Download button from the PDF Viewer toolbar, so I assumed that the patch landed.
I can reproduce with Ctrl
+S
so I'm setting this as New.
Thanks a lot, Jonas!
Assignee | ||
Comment 6•4 years ago
•
|
||
Brendan, any chance of a PDF.js update such that we can land this patch?
Comment 7•4 years ago
|
||
I'll make an update today. It looks like it should be fine to land this without the update? It won't work, but no side affects.
Assignee | ||
Comment 8•4 years ago
|
||
(In reply to Brendan Dahl [:bdahl] (84 regression triage) from comment #7)
I'll make an update today.
Thank you!
It looks like it should be fine to land this without the update? It won't work, but no side affects.
You're right, of course :-)
Comment 10•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Comment 11•4 years ago
|
||
Reproduced the issue with Firefox 88.0a1 (20210223230332) on Windows 10x64.
The issue is verified fixed with Firefox 88.0b7 (20210404185932) on Windows 10x64, macOS 10.12 and Ubuntu 18.04. The PDF document is correctly saved with the correct name.
Description
•