Closed Bug 1653117 Opened 7 months ago Closed 6 months ago

PDFs default to "Open with Firefox" when I've said I don't want that


(Firefox :: File Handling, defect)

78 Branch



81 Branch
Tracking Status
firefox81 --- verified


(Reporter: lasdka88+mozbugs, Assigned: jaws)


(Blocks 2 open bugs)



(3 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Steps to reproduce:

Prior to Firefox 78.0.2, I had configured Firefox to "Always Ask" for PDF content-types. This worked the way I want it: When I clicked on a link that serves a PDF I was presented with a choice between opening in an external application (most common) or saving the PDF somewhere specific instead. Opening in an external document viewer was the default, which is fine.

When Firefox upgraded to 78.0.2, it decided it knew better and changed the preference to "Open in Firefox" for PDFs. That was mildly annoying. I didn't want PDFs rendering in Firefox, so I found the setting and changed it back again.

So far so good.

Actual results:

Now when I follow a link that serves a PDF document, Firefox opens a dialog that has three options:

  1. Always selected by default! Open with Firefox
  2. Open with: Document Viewer (default)
  3. Save File
    [ ] Do this automatically for files like this from now on.

Expected results:

Firefox should NOT have defaulted to "Open with Firefox".

The whole reason why I changed my preference away from "Open in Firefox" is because I DON'T want it to open in Firefox. Hence this is a silly default which is forcing me to constantly fight against Firefox, switching away from that option every time. Except I often forget that the behaviour has changed and now I am accidentally opening documents in Firefox when I intended to open them in an external document viewer.

Acceptable alternatives would have been:

a. to default to the option for opening in a document viewer (the previous behaviour), or
b. to default to whatever I actually chose last time (assuming there was a last time) .

I prefer option a). However, there is a small possibility that some people would like to choose between opening in Firefox and saving the document, and there may be some people who almost always want to save, but occasionally want to do something different, and for those people, b) would be a better choice.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → File Handling
Attached image default pdf.PNG

Hi lasdka,
I've tested this with this pdf file to try replicate on my end.
As soon as I try to download, I have Save File marked as default option.
Can you please attach a screenshot to demonstrate the issue.
Also, try this on the latest version of nightly. You can download it from here:


Flags: needinfo?(lasdka88+mozbugs)

The bug can be reproduced as follows:

  1. Start with fresh install of Firefox and a new profile. Tested with both Firefox 78.0.2 (64-bit) and Nightly 88.0a1 (2020-07-25).
  2. Change to Always Ask for PDFs
  3. Request a PDF document. By default, the dialog has three options. The second, "Open with..." is selected. If you choose the "Open with..." option, it looks like this the next time too.
  4. Choose to "Open with Firefox/Nightly" once.
  5. From this point onwards, the dialog will always default to "Open with Firefox/Nightly", regardless of what other option you choose. The preference is unchanged from "Always Ask for PDFs".

As per the above, it is necessary to choose "Open with Firefox/Nightly" once. From that point onwards, this appears to be enforced as the default, no matter what you do.

Flags: needinfo?(lasdka88+mozbugs)
Blocks: 1631105

OK, this is an annoying bug that we should fix.

To explain a bit about what's going wrong here: internally, Firefox stores 2 things that get represented in the 1 dropdown in the Options. It stores what your preferred action is (save file, open with Firefox, open with some other app) and whether to ask you (yes/no) what to do. So the dropdown shows "always ask" but doesn't show you what the preferred option is, if "always ask" is turned on.

The second part of the issue here is whether the preferred action we store internally is changed based on the dialog. I'd expect that either:

  • this only happens if you tick the "always do this" checkbox OR
  • this always happens

but instead, it appears that we change the internal preferred action if you select "open in Firefox", but we do not change the internal preferred action if you select "open with [external app]". I expect that's the result of a discrepancy between the two logic parts in this (frankly, awful and archaic) dialog (which we're hoping to change significantly or remove, "soon", which probably means it'll take us a while...).

Jared, can you take a look at this and see if there's a simple fix to make this behaviour better (probably also store the "open with external viewer" thing as the preferred action even if "always ask" is turned on (without turning off "always ask", of course)) ?

Ever confirmed: true

Jared: needinfo for comment 4. :-)

Flags: needinfo?(jaws)
No longer blocks: 1639067
Assignee: nobody → jaws
Flags: needinfo?(jaws)
Pushed by
If we show the handle internally option then we should be able to persist the user choice. r=Gijs
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
Blocks: 1660113
Regressions: 1660277

This issue is Verified as fixed In Beta 81.0b8 on Mac, Windows and Ubuntu.

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