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.

marked as duplicate by user47206, karel, Fabby, David Foerster, Eric Carvalho May 29 '18 at 15:59

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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.

  • 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. – Dorian 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 – user47206 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. – Dorian May 23 '18 at 3:13
  • 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. – Dorian May 23 '18 at 16:22
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
  • 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 – user47206 May 22 '18 at 20:21
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. – Dorian May 24 '18 at 20:08

Not the answer you're looking for? Browse other questions tagged or ask your own question.