4

When I download a PDF and try to open it from the Downloads window, it will attempt to open it in File Roller, which will complain that about PDF not being a supported archive type; I'd like to open it in Document Viewer instead. How do I do that from Firefox, other than going through Nautilus?

When opening the PDF from Nautilus, it opens the file correctly in Document viewer. I also went in about:preferences#applications and set Use Document Viewer (default) as the action for PDFs, but it didn't work.

  • There is an article on troubleshooting this at Firefox's website: https://support.mozilla.org/en-US/kb/how-to-fix-preferences-wont-save. Maybe go through it and see if it helps? – edwinksl Jun 24 '16 at 17:10

3 Answers3

0

Some newly installed applications take over the "default" status in FF's about:preferences instead of the per-filetype normal application set at system level (e.g. Palemoon takes over as default instead of gwenview for jpeg files, Inskape or File Roller takes over instead of Okular for pdf file.).

"Always ask" is the choice that should be used in this case and then trying to create a per-user file ~/.local/share/applications/mimeinfo.cache with the lines:

[MIME Cache]
application/pdf=okularApplication_pdf.desktop

The disadvantage of the above is that it is a per-file-type setting. To have a solution for all files (as said in this answer), run:

cd .local/share/applications/
ln -s mimeapps.list defaults.list

In case this stops working: see that the undesired application is not again selected under about:preferences: be sure "Always ask" is selected there. Setting manually a different program (even the default for your file-type at system level, but which is not marked as "default" in the list for your file under about:preferences) might not work.

Tested in Firefox 60.0 in Kubuntu 18.04.


Something is not right with the Firefox settings. "Always ask" and "Save file" do not make sense for files already downloaded, therefore settings under about:preferences shouldn't affect the Downloads list. But they do. And they do in an inconsistent manner: only selecting the application marked as default is followed, switching to another application is not. To reverse that one might need to select "Always ask" and then follow the steps mentioned above.

  • You shouldn't be editing mimeinfo.cache since it's regenerated when software is added/removed, and Firefox doesn't use it anyways, only Gnome does. Firefox calls gnome-vfs API or GIO for defaults. Better to use default.list or mimeapps.list and look at update-mime-database. I'm guessing by manually editing all these files you may have created more issues for yourself which is why you're having more problems now. – Delorean May 24 '18 at 20:08
0

Firefox uses its own rules on how to handle file types and can be different than Nautilus.

Click the Firefox menu button and select Options.
In Options, click Applications then select the file type PDF. In the Action section, change the action for how you want to open the file.

If it's already set, change it to something else, and then back to the PDF viewer.

Delorean
  • 10,923
  • The OP said he tried that but it didn't work. Something else is amiss. – edwinksl Jun 24 '16 at 17:08
  • Ah, he was talking about Nautilus so I assumed he was trying to change Nautilus settings. – Delorean Jun 24 '16 at 17:22
  • that affects what happens to pdf files accessed inside Firefox (wheter to download them or open them etc), not what the OP asks, namely to set the program that opens a pdf already downloaded, listed and clicked in the downloads list –  May 22 '18 at 20:22
  • @cipricus Correct, in the downloads list, which is managed by Firefox, and why you need to change the Firefox settings, as I said. I'm not sure what about my answer confused you. – Delorean May 23 '18 at 03:13
  • In Options, click Applications then select the file type PDF. In the Action section, change the action for how you want to open the file. - from my own experience, that has no effect on what happens when clicking the files listed in the downloads list/window (what the OP asks); it affects the files accessed online within the browser –  May 23 '18 at 06:20
  • I have posted an answer with some details on pdfs under the above question here; more details in this answer; the above question is a duplicate of this one. –  May 23 '18 at 06:37
  • 1
    @cipricus Not sure why it doesn't work for you. Works for me in Ubuntu 16.04 with FF 59 and Ubuntu 18.04 with FF 60 as well as in Manjaro and openSUSE with FF 60... That's how I change mine, because for one example, I like images to open in Photoshop. Changing the settings in Firefox like I said in my answer works for me. You should never have to edit files manually for it work. – Delorean May 23 '18 at 16:22
  • It gets complicated. You are right that if changes are made under about:preferences they are reflected by the program used to open files in the Downloads list. But only up to a point. Example: looking there for jpeg setting I have tested by switching to Pale Moon browser: that was followed. Then changed to the normal gwenview: that was not followed. Looking in usr/share/applications/mimeinfo.cache, now Palemoon is the first listed after image/jpeg=. I have to look more into this and re-edit my answer(s), as the two commands I have mentioned does not fix it. –  May 24 '18 at 11:07
  • Something is not right with the Firefox settings. "Always ask" and "Save file" do not make sense for files already downloaded, therefore settings under about:preferences shouldn't affect the Downloads list. But they do. And they do in an inconsistent manner: only selecting the application marked as default is followed, switching to another application is not. To reverse that one might need to select "Always ask" and then follow the steps mentioned above. - I have edited my answer. –  May 24 '18 at 11:42
0

There are several settings for PDFs in Firefox - for different MIME content types - see the screenshot.

PDF lines in Firefox Application settings

Is it possible that you changed just one of the lines to Use Document Viewer (default), but at least one of the others is still configured to use File Roller?

Please note that, to my knowledge, you cannot configure the other lines to be opened directly in Firefox. You would have to select Evince or whatever PDF reader you want to use.

Try different PDFs, e.g.:

  • this soccer rules document opens internally in Firefox on my computer
  • this one does NOT open internally, but gives me a prompt where I can download or open in external PDF editor
okolnost
  • 1,140
  • that affects what happens to pdf files accessed inside Firefox (wheter to download them or open them etc), not what the OP asks, namely to set the program that opens a pdf already downloaded, listed and clicked in the downloads list –  May 22 '18 at 20:21