PDF file gets downloaded unexpectedly when using "Open with Firefox" to open a PDF
Categories
(Firefox :: File Handling, defect)
Tracking
()
People
(Reporter: buglinking, Unassigned)
Details
Attachments
(1 file)
4.91 MB,
video/quicktime
|
Details |
[Affected versions]:
- Firefox 115.0.2 (64-bit)
[Affected Platforms]:
- MacOS 13.3.1 (22E261)
[Preconditions]:
- Set ‘always ask’ for ‘Portable Document Format (PDF)’ under Applications in 'about:preferences'
[Steps to reproduce]:
- Launch Firefox
- Open a random *.pdf file (e.g. www.africau.edu/images/default/sample.pdf)
- Select "Open with Firefox"
- Click the "OK" button.
[Expected result]:
- The pdf file shouldn't be downloaded.
[Actual result]:
- The pdf file is downloaded.
[Notes]:
- If set 'Open in Firefox' for ‘Portable Document Format (PDF)’ under Applications in 'about:preferences', the pdf doesn't get downloaded.
Comment 1•1 year ago
|
||
If you set a filetype to "always ask" and then open such a file, the browser starts downloading the bytes when the request starts (which is also when it learns what the file is that you asked it to open, as this information is in the response headers that come from the server). At that point, we show you the dialog - but the HTTP request is open and will keep handing us the response bytes (ie the PDF file), while you (the browser user) make a decision about what to do. Those bytes have to go somewhere. Right now, we do the same thing for all files - we put them in the downloads directory. If you cancel, we remove the file. If you open the file, we can pass the file directly to the external application in question. If you open in Firefox, effectively the same thing happens.
As a workaround, you can tell Firefox to instead use the tmp folder for these files (cf. bug 1738574). Or you can set PDFs to "open in Firefox" by default and then download them from the PDF.js UI if you prefer. You can then also override whether the server says the PDF ought to be downloaded, should you want to, using the browser.download.open_pdf_attachments_inline
preference.
But on the whole this is basically an exact dupe of bug 1762955.
Description
•