User Agents

Web browsers and everyday web tech, explained

Why Firefox Saves PDFs to Downloads Before Opening

· 7 min read · Browsers

In this article
  1. Background: How Firefox Handles PDFs
  2. How Firefox's PDF Action Works
  3. How to Change Firefox to Open PDFs Directly
  4. Common Problems and Misconceptions
  5. Comparison with Other Browsers
  6. Safety and Privacy Considerations
  7. Alternatives and Advanced Options
  8. Frequently Asked Questions

Firefox saves PDFs to your Downloads folder before opening them in its built-in viewer because the browser's default PDF handling is set to “Save File,” which downloads the file first and then launches the viewer from the saved copy. This behavior is controlled by Firefox's “Applications” settings, where the action for PDF files can be changed to “Preview in Firefox” to open them directly without saving.

Background: How Firefox Handles PDFs

Firefox includes a built-in PDF viewer called PDF.js, which is a JavaScript-based renderer that runs inside the browser tab. Since Firefox 19 (released in 2013), PDF.js has been the default way to open PDFs, replacing external plugins like Adobe Acrobat. However, the default action for PDF files is not to preview them directly; instead, Firefox treats PDFs like any other download and saves them to disk first. This is a deliberate design choice that ensures the file is available locally before the viewer tries to access it, which can improve performance and reliability, especially for large PDFs.

The reason Firefox does this is partly historical: before PDF.js matured, Firefox relied on external viewers that needed a local file path. Even after PDF.js became stable, the default behavior remained “Save File” to avoid breaking workflows that expect the file to be in the Downloads folder. Many users have come to expect this behavior, and changing it by default could confuse those who rely on the saved copy for later use.

How Firefox's PDF Action Works

Firefox's handling of PDFs is governed by the “Applications” settings, which map file types to actions. For PDFs, the default action is “Save File,” meaning that when you click a PDF link, Firefox downloads the file to your Downloads folder and then opens it in the built-in viewer. The viewer reads the file from the local copy, which is why you see the file appear in Downloads even if you only intended to view it.

The process is straightforward:

  1. You click a link to a PDF.
  2. Firefox checks the file type and looks up the associated action in its settings.
  3. If the action is “Save File,” Firefox downloads the PDF to your Downloads folder.
  4. After the download completes, Firefox opens the saved file in the built-in PDF viewer.

This two-step process is different from browsers like Chrome, which open PDFs directly in a viewer without saving a copy by default. Firefox's approach can be changed, but many users are unaware of the setting.

How to Change Firefox to Open PDFs Directly

If you prefer that Firefox open PDFs in the viewer without saving them first, you can change the default action in the settings. The exact menu labels may vary slightly by Firefox version, but the steps are generally the same:

  1. Click the menu button (three horizontal lines) in the top-right corner.
  2. Select “Settings” (or “Options” on some systems).
  3. Scroll down to the “Applications” section.
  4. Find “Portable Document Format (PDF)” in the list.
  5. Click the drop-down menu next to it and select “Preview in Firefox.”

After this change, Firefox will open PDFs directly in the viewer without downloading them first. The file will still be available in the browser's cache, but it won't appear in your Downloads folder unless you explicitly save it. You can also choose “Use Adobe Acrobat” if you have it installed, or “Always Ask” to be prompted each time.

Common Problems and Misconceptions

One common misconception is that Firefox is “broken” because it saves PDFs instead of opening them. In reality, this is the default behavior, not a bug. Another issue users encounter is that after changing the setting to “Preview in Firefox,” the browser still downloads the file. This can happen if the website forces a download header (e.g., Content-Disposition: attachment), which overrides Firefox's action. In such cases, the site's server explicitly tells the browser to save the file, and Firefox complies.

Another problem is that the built-in viewer may not render some PDFs correctly, especially those with complex formatting or forms. Users sometimes assume this is related to the download behavior, but it's a separate issue with PDF.js. If a PDF doesn't display well, you can download it and open it in Adobe Acrobat or another viewer.

Comparison with Other Browsers

Firefox's default behavior contrasts with Chrome and Edge, which open PDFs directly in their built-in viewers without saving a copy. Chrome, for example, uses its own PDF viewer and does not save the file unless the user explicitly clicks the download button. Edge similarly opens PDFs in a viewer, though it also offers a “Save as” option. Safari on macOS also opens PDFs directly in the browser window, but it may use Preview for certain actions.

The difference is partly philosophical: Firefox's approach ensures the file is always available locally, which can be useful for offline access or for users who want to keep a copy. However, it can clutter the Downloads folder and confuse users who expect a quick preview. Firefox's flexibility allows you to choose your preferred behavior, whereas Chrome and Edge are more rigid in their default handling.

Safety and Privacy Considerations

When Firefox saves a PDF to your Downloads folder, the file remains on your hard drive even after you close the viewer. This can be a privacy concern if you're viewing sensitive documents on a shared computer. To mitigate this, you can change the setting to “Preview in Firefox” so the file is not saved, or you can regularly clear your Downloads folder. Additionally, PDF files can contain malicious scripts or exploits, so it's important to keep your browser and PDF viewer updated. Firefox's built-in viewer is sandboxed, which reduces the risk, but no viewer is completely immune to vulnerabilities.

If you're concerned about privacy, consider using Firefox's Private Browsing mode, which does not save downloaded files to your Downloads folder by default—it stores them in a temporary location and deletes them when the session ends. However, this is not a substitute for changing the PDF action if you want to avoid saving files altogether.

Alternatives and Advanced Options

If you want more control over PDF handling, you can use extensions or add-ons. For example, the “PDF Viewer” extension replaces the default viewer with a more feature-rich one. You can also set Firefox to always ask what to do with PDFs by selecting “Always Ask” in the Applications settings. This gives you a prompt each time you click a PDF link, allowing you to choose between previewing, saving, or opening with an external application.

Another option is to disable the built-in viewer entirely and use an external program like Adobe Acrobat. In the Applications settings, you can set PDFs to open with Adobe Acrobat, which will launch the program and load the file. Note that this still downloads the file first, because external programs need a local file path. If you want to avoid saving, you'd need to use a browser extension that streams the PDF without saving, but that's less common.

Frequently Asked Questions

Why does Firefox save PDFs even after I changed the setting?

If you've set PDFs to “Preview in Firefox” but they still download, the website is likely sending a header that forces a download. This is common on sites that want to protect content or track downloads. You can't override this from the browser side; the site's server controls the behavior.

Does Firefox's PDF viewer save a copy to Downloads?

No, when you use “Preview in Firefox,” the PDF is not saved to your Downloads folder. It is loaded into the viewer from the network and only exists in memory (or cache). However, if you use the download button in the viewer, it will save a copy.

Can I make Firefox open PDFs in Adobe Acrobat instead of the built-in viewer?

Yes, in the Applications settings, change the PDF action to “Use Adobe Acrobat” (or another installed PDF reader). This will download the file first and then open it in that program. The download is necessary because external programs need a local file.

Is it safe to open PDFs in Firefox's built-in viewer?

Generally, yes. The built-in viewer is sandboxed, meaning it runs in a restricted environment that limits the damage a malicious PDF can do. However, no software is perfect, so keep Firefox updated to get the latest security patches.

Why does Firefox download PDFs but Chrome doesn't?

Firefox's default action for PDFs is “Save File,” while Chrome's default is to preview them. This is a design choice by Mozilla, likely to ensure the file is available locally. You can change Firefox's behavior to match Chrome by selecting “Preview in Firefox.”