This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

ابحث في الدعم

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Stop downloading PDFs and making URLs hard to find

  • 4 ردود
  • 1 has this problem
  • 95 views
  • آخر ردّ كتبه cor-el

more options

Firefox Developer Edition 85.0b4, macOS 10.15

If I Google for a PDF and click a link, I get the Firefox download dialog. If I select "Open with Firefox [Developer Edition]", the following things happen:

  • The PDF is downloaded to ~/Downloads
  • The PDF is opened in a new tab, with that new tab's location bar holding a file:///... URL to the downloaded PDF

What I would instead like to happen is:

  • The PDF is downloaded to some temporary directory where I won't have to worry about deleting it manually
  • In whatever tab the PDF is displayed in, the location bar contains the URL where the PDF was (temporarily!) downloaded from

How can I achieve this?

Not having the URL where a PDF was opened from is very annoying when, for example, I open a bunch of PDF search results to read and review, and I later want to share links to some of those PDFs. Best I can do to find their URLs to give to others is then to try and remember which tab corresponds to which search result, or do mine the downloads tab.

Contrast this with Chrome: I click a Google result for a PDF and the PDF just opens in the current tab with the URL to the PDF in the location bar. No dialogs, no PDF files hanging around in my home directory, and I can just copy the URL to the PDF the same way I'd copy the URL to any web page.

Thank you!

Firefox Developer Edition 85.0b4, macOS 10.15 If I [https://www.google.com/search?q=facebook+and+the+future+of+fair+housing+online+filetype%3Apdf Google for a PDF] and click a link, I get the Firefox download dialog. If I select "Open with Firefox [Developer Edition]", the following things happen: * The PDF is downloaded to ~/Downloads * The PDF is opened in a new tab, with that new tab's location bar holding a file:///... URL to the downloaded PDF What I would instead like to happen is: * The PDF is downloaded to some temporary directory where I won't have to worry about deleting it manually * In whatever tab the PDF is displayed in, the location bar contains the URL where the PDF was (temporarily!) downloaded from How can I achieve this? Not having the URL where a PDF was opened from is very annoying when, for example, I open a bunch of PDF search results to read and review, and I later want to share links to some of those PDFs. Best I can do to find their URLs to give to others is then to try and remember which tab corresponds to which search result, or do mine the downloads tab. Contrast this with Chrome: I click a Google result for a PDF and ''the PDF just opens in the current tab with the URL to the PDF in the location bar''. No dialogs, no PDF files hanging around in my home directory, and I can just copy the URL to the PDF the same way I'd copy the URL to any web page. Thank you!

الحل المُختار

Sigh. It appears the problem was one or both of the following preferences:

  • pdfjs.enabledCache.state: false
  • pdfjs.migrationVersion: 2

I deleted both, and now clicking on a PDF just opens in the sane, normal way in Firefox that I desire.

Naturally I have no idea how those got set.

Read this answer in context 👍 0

All Replies (4)

more options

الحل المُختار

Sigh. It appears the problem was one or both of the following preferences:

  • pdfjs.enabledCache.state: false
  • pdfjs.migrationVersion: 2

I deleted both, and now clicking on a PDF just opens in the sane, normal way in Firefox that I desire.

Naturally I have no idea how those got set.

more options

Note that this is supposed to happen if you use "Open in Firefox" to open a PDF in Firefox instead of saving the file or open the file in an external application (PDF viewer). This causes the file to get downloaded to the temp folder and the resulting file:// link to the file in the temp folder is opened in a Firefox tab. This still creates an history entry that has the URL where you downloaded this file, so you can check the history from around the time you looked at this file..

more options

cor-el said

Note that this is supposed to happen if you use "Open in Firefox" to open a PDF in Firefox instead of saving the file or open the file in an external application (PDF viewer).

Understood, thanks. After I deleted my pdfjs.enabledCache.state=false pref, I stopped even getting a dialog: clicking on links to PDFs where the server doesn't force download now just shows the PDF right in the tab, with the remote URL in the location bar, just like I expected. No more downloading.

more options

Firefox should open the PDF file in a tab if the server sends it as "application/pdf". If the file is send as a generic type like "application/octet-stream" or send as "content-disposition:attachment" then you get the choice in the download dialog to open the PDF file in Firefox. In case you choose the latter then you get the described behavior with getting a file:// link to a file in the temp folder.