Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

Trang web này sẽ có chức năng hạn chế trong khi chúng tôi trải qua bảo trì để cải thiện trải nghiệm của bạn. Nếu một bài viết không giải quyết được vấn đề của bạn và bạn muốn đặt câu hỏi, chúng tôi có cộng đồng hỗ trợ của chúng tôi đang chờ để giúp bạn tại @FirefoxSupport trên Twitter và /r/firefox trên Reddit.

Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Tìm hiểu thêm

Stop downloading PDFs and making URLs hard to find

  • 4 trả lời
  • 1 gặp vấn đề này
  • 1 lượt xem
  • Trả lời mới nhất được viết bởi 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!

Giải pháp được chọn

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.

Đọc câu trả lời này trong ngữ cảnh 👍 0

Tất cả các câu trả lời (4)

more options

Giải pháp được chọn

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.