为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

FF 108.0.1 automatically downloads now, even though ASK WHERE is checked in Settings

  • 4 个回答
  • 0 人有此问题
  • 1 次查看
  • 最后回复者为 Shane

more options

Windows FF 108.0.2 automatically downloads PDF files now, even though ASK WHERE is checked in Settings. I have, for YEARS, had FF set to ask me where to store any download, and it is still set that way. And whenever I opened a PDF link, FF would display the link in its PDF viewer, and if I wanted to download it, I would click the PDF viewer download button.

However, now FF automatically downloads it to disk FIRST, popping up the Downloads box showing progress, before ever displaying it on screen. What changed? This seems like a HUGE security risk.

Windows FF 108.0.2 automatically downloads PDF files now, even though ASK WHERE is checked in Settings. I have, for YEARS, had FF set to ask me where to store any download, and it is still set that way. And whenever I opened a PDF link, FF would display the link in its PDF viewer, and if I wanted to download it, I would click the PDF viewer download button. However, now FF automatically downloads it to disk FIRST, popping up the Downloads box showing progress, before ever displaying it on screen. What changed? This seems like a HUGE security risk.

被采纳的解决方案

There is an invisible reason behind these discrepancies for what happens when you've kept the Open in Firefox option.

Problem: inline vs. attachment disposition

If web servers don't specify how Firefox should handle a PDF, or if they specify "inline" handling, then then Firefox loads the PDF as web content with its original URL in the address bar. The PDFs are saved with other cached web content, not in your downloads folder. This is good.

But web servers can try to force a download by setting Content-Disposition: attachment if they don't want browsers to show the files in a tab. In this case, Firefox downloads and saves the file automatically and then opens it in a new tab. Because these are saved to disk the URLs start with file:///. By default, they are saved in your "Save files to" folder on the Settings page (you are not asked where to save files when you've selected "Open in Firefox").

Solution: Hard-to-find option for using the web content cache for all PDFs

Firefox 103 got an option to modify the above. Here's how you set it up:

(a) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button accepting the risk.

More info on about:config: Configuration Editor for Firefox. The moderators would like us to remind you that changes made through this back door aren't fully supported and aren't guaranteed to continue working in the future. I'm using this so I feel comfortable mentioning it.

(b) In the search box in the page, type or paste browser.download.open_pdf_attachments_inline and pause while the list is filtered

(c) Double-click the preference to switch the value from false to true

定位到答案原位置 👍 1

所有回复 (4)

more options

Yeah,

You need to go into Tools -> Settings -> General and set the Action for the types of downloads (Applications) to Always Ask for those types you want it to. If it's set to just Save File then it just saves it in whatever the download directory you've set is.

For me, I have Portable Document Format set to Open in Firefox then it just displays it in Firefox without saving it in my download directory that I have defined.

Hope that helps.

more options

Yeah, I tried that too.Yesterday, on a particular web site (IRS.GOV), and very time I clicked on a PDF link, FF opened the link, but didn't download it. I then downloaded them manually. That is the behavior I would expect (and want). However, this morning, I just clicked on PDF link from another web site, and it immediately downloaded it, then displayed it. It was a .PDF file on disk. Attached are the settings at the time. Perhaps the gremlin woke up from its nap.

UPDATE: OK, this is weird. I have ONE web site offering a download link to a PDF invoice which, when I click on it, FF automatically downloads it and THEN displays it in the built-in browser (with the sidebar pulled out). On the IRS.GOV site, when I click on one of their form links, FF displays the PDF in the built-in browser (with sidebar collapsed), but doesn't download it automatically. The link on hover on the IRS site points to a .PDF file, whereas the link on the other Invoice site shows a PDF icon with a clickable link which on hover looks to be a HTTP GET command (with a long string proceeded by a "URL\?"), not a distinct .PDF file. I can do this all day with the same behavior for each site. Is the lack of a .PDF in the URL the cause of this? FF clearly KNOWS it is a PDF since it opens its own browser to display it, and downloads it to a .PDF file. Also, checking the option labeled "Ask whether to open or save files" below the big box under "What should Firefox do with other files?" doesn't change the stated behavior either (as one might expect).

Any ideas?

more options

选择的解决方案

There is an invisible reason behind these discrepancies for what happens when you've kept the Open in Firefox option.

Problem: inline vs. attachment disposition

If web servers don't specify how Firefox should handle a PDF, or if they specify "inline" handling, then then Firefox loads the PDF as web content with its original URL in the address bar. The PDFs are saved with other cached web content, not in your downloads folder. This is good.

But web servers can try to force a download by setting Content-Disposition: attachment if they don't want browsers to show the files in a tab. In this case, Firefox downloads and saves the file automatically and then opens it in a new tab. Because these are saved to disk the URLs start with file:///. By default, they are saved in your "Save files to" folder on the Settings page (you are not asked where to save files when you've selected "Open in Firefox").

Solution: Hard-to-find option for using the web content cache for all PDFs

Firefox 103 got an option to modify the above. Here's how you set it up:

(a) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button accepting the risk.

More info on about:config: Configuration Editor for Firefox. The moderators would like us to remind you that changes made through this back door aren't fully supported and aren't guaranteed to continue working in the future. I'm using this so I feel comfortable mentioning it.

(b) In the search box in the page, type or paste browser.download.open_pdf_attachments_inline and pause while the list is filtered

(c) Double-click the preference to switch the value from false to true

more options

THIS ^^^ Absolutely solved the issue!

Thanks for the details and helping me understand the intricacies of what was happening. I'm sometimes too quick to blame FF for difficult issues.

Cheers mate. Shane