Closed Bug 1694556 Opened 4 years ago Closed 4 years ago

PDF.js ignores content-disposition filename

Categories

(Firefox :: PDF Viewer, defect)

Firefox 86
defect

Tracking

()

VERIFIED FIXED
88 Branch
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:

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.

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.

Component: Untriaged → PDF Viewer
Assignee: nobody → jonas.jenwald

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!

Flags: needinfo?(naaoffupzhgyjmssxg)

(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).

Flags: needinfo?(naaoffupzhgyjmssxg)

(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!

Status: UNCONFIRMED → NEW
Ever confirmed: true

Brendan, any chance of a PDF.js update such that we can land this patch?

Flags: needinfo?(bdahl)

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.

Flags: needinfo?(bdahl) → needinfo?(jonas.jenwald)

(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 :-)

Flags: needinfo?(jonas.jenwald)
Pushed by bdahl@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3f23121524b1 Send the Content-Disposition filename to the PDF Viewer. r=bdahl
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch

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.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: