Closed Bug 1844322 Opened 1 year ago Closed 1 year ago

PDF file gets downloaded unexpectedly when using "Open with Firefox" to open a PDF

Categories

(Firefox :: File Handling, defect)

Firefox 115
Desktop
All
defect

Tracking

()

RESOLVED DUPLICATE of bug 1762955

People

(Reporter: buglinking, Unassigned)

Details

Attachments

(1 file)

Attached video pdfDownload.mov

[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]:

  1. Launch Firefox
  2. Open a random *.pdf file (e.g. www.africau.edu/images/default/sample.pdf)
  3. Select "Open with Firefox"
  4. 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.

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.

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Duplicate of bug: 1762955
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: