Closed Bug 1733362 Opened 3 years ago Closed 3 years ago

Firefox always uses built-in pdf reader on links to local PDFs from locally stored html files when PDFs are configured to "always ask"

Categories

(Firefox :: File Handling, defect)

Firefox 92
defect

Tracking

()

RESOLVED WONTFIX

People

(Reporter: Hartmut, Unassigned)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

Attached file index.html

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

Steps to reproduce:

  1. Put the attached file index.html on your local drive
  2. Put a PDF file in the same directory and rename it to test.pdf.
    3.Open Firefox and Configure it to always ask, when opening PDF Files
  3. Use File/Open to open the file index.html
  4. click on "PDF test file stored on local file system" to open it.

Actual results:

Firefox displays that file using it's built-in pdf reader

Expected results:

Firefox should ask, what to do (use internal/external reader or download it)

This bug came in on transition from Firefox 90.0 to Firefox 91.0b1. Versions before do ask as expected, but versions including and after 91.0b1 always use the built-in reader.
Note#1: PDF-Files on web-servers (second link in my index.html-file) are NOT affected.
Note#2: Please note that this bug is probably related to
https://bugzilla.mozilla.org/show_bug.cgi?id=1732868
Same behaviour, BUT that bug came in on transition from Firefox 77.0 to Firefox 78.0b1

I confirm the issue on nightly on linux.
:Gijs, maybe you'll have an idea here.

Flags: needinfo?(gijskruitbosch+bugs)

This was a deliberate change because in Firefox 90 and before, the dialog option to open the PDF inside Firefox didn't actually work. We fixed in bug 1680147 by just defaulting to opening in Firefox (which, before 91, we also already did if you opened a local PDF with Firefox by passing it the link from the OS, e.g. by using your standard file explorer app to open the file with Firefox -- even if you had it set to "always ask" or similar).

As I explained in bug 1680147 comment 3, fixing this so we show the dialog, and making the "open in Firefox" option in that dialog work from file: URLs is not straightforward, for various reasons, which is why I chose to fix the issue this way. You're already in Firefox, looking at a file: listing - so it's not that unreasonable to just open the file in PDF.js - it's what we would do for pretty much all other files that Firefox itself can display.

You can get the same dialog by clicking on the floppy disk / save file button in the PDF.js toolbar, and can then choose the "open externally" or "Save to disk" behaviours if that's what you really wanted.

If you never want PDF.js you can disable it entirely using the pdfjs.disabled pref in about:config, or the relevant enterprise policy, which will probably also produce the behaviour you want here.

I have to confess I'm struggling to understand the usecase here for the behaviour you want. "Downloading" a file that is already stored on file:/// is not really a useful thing to do. If you want to open the PDF with an external viewer, you can make that the default, and as of Firefox 93, released next week, that will work (fixed in bug 1726501).

At this point, there are so many workarounds and ways to configure this that I don't think it makes sense to spend what would be a lot of time to address this issue, so I would like to suggest wontfix. Calixte, thoughts?

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(gijskruitbosch+bugs) → needinfo?(cdenizet)
Regressed by: 1680147
Summary: Firefox always uses built-in pdf reader on links in locally stored html files → Firefox always uses built-in pdf reader on links to local PDFs from locally stored html files when PDFs are configured to "always ask"
Has Regression Range: --- → yes

The Bugbug bot thinks this bug should belong to the 'Firefox::File Handling' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → File Handling

Just an explanation of my usecase:
On my NAS (which is configured as a webserver as well), I have a lot of pdf documents, organized and made accessible from firefox by several self-written html files. For offline work (without access to the internet / NAS), I rsync to a local copy of the whole directory tree on the hard disk of my laptop. So, if I have access to the NAS I use those files, but if I don't, I can do just the same while working on my local drive.
This worked fine for years until to Firefox 91 came out.
To be honest, the built-in reader is not that bad, but it does not offer something like "show me two FULL pages side by side" (two pages is possible, but I have to scroll up and down to see the top / bottom part), or add remarks to my pdf, and the window available for pdf's is reduced by firefox menu bar, tab names, tool bar etc. (Of course I could enter presentation mode, but switching between different files / tabs etc. while reading makes this not very comfortable.
But, to come back to your last comment, making external reader the default, or disabling the built-in one, is totally acceptable for me.
Thanks!

:Gijs, agreed.

Status: NEW → RESOLVED
Closed: 3 years ago
Flags: needinfo?(cdenizet)
Resolution: --- → WONTFIX

I agree that Save is not a useful option if the file is already on the PC.
The two options that ARE useful are "Open in Firefox" or "Open with" an external application. The Firefox PDF viewer is sufficient for viewing but it does not include all of the function of a PDF application like Adobe.
The suggested change of setting the pdfjs.disabled option only allows "Open with" and "Save" so this isn't a good solution.

(In reply to rrhbarlow from comment #10)

I agree that Save is not a useful option if the file is already on the PC.
The two options that ARE useful are "Open in Firefox"

When the dialog showed up for local files, this option didn't work for local files. It just did nothing. That's why the behaviour was changed.

or "Open with" an external application. The Firefox PDF viewer is sufficient for viewing but it does not include all of the function of a PDF application like Adobe.
The suggested change of setting the pdfjs.disabled option only allows "Open with" and "Save" so this isn't a good solution.

As I noted in the other bug, you can still get the dialog you want to appear by clicking the "save" button in the PDF viewer that shows up (folder icon with an arrow, near the top right, next to the print icon).

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: