When I download a file with firefox, it always asks me with what program I want to open it with, even when that type of file is recognized by the system, and I can double click on it in Nautilus and have it open properly.
This is an example with a deb file, which opens with Ubuntu Software center (as it should) when I double click on it in Nautilus.
I do not want to look for the required program in /usr/bin or whatever in the Firefox dialog, I want Firefox to recognize my system preferences. What I resort to doing now is choose "Download", open Nautilus and double click on the file...
Why can't Firefox recognize my system settings, and how do I get it to?
Thanks!
Use
/usr/bin/xdg-open
(it's part ofxdg-utils
package) to open all the files.I can provide some perspective on why Firefox isn't more tightly integrated into Ubuntu. Applications like Firefox and OpenOffice/Libreoffice are designed to work on a wide variety of operating environments including various Linux distributions, Desktop environments, Windows OS, Apple OS and many others. All of those environments are moving targets. For example Gnome has gone to GTK 3.0 but not every application in the latest Ubuntu release has upgraded from GTK 2.0 and of course let's not forget Unity has entered the fray. To that end Firefox and their ilk loosely couple with operating environments so that development can focus on the core features of the application. Being all things to all people or for applications in this case all environments can be destructive to core goals. Clearly tight integration is conceivable and desirable from an individual user's perspective. It's a matter of priorities and complexity. The desirability of regular concurrent releases for all environments is also a factor.
There are different settings involved here:
What program Firefox proposes when downloading a file (as in the image posted in the question)
What program Firefox uses when accessing an online file
What program opens a file already downloaded when clicked in the Firefox downloads list.
For the first two options, the "Applications" settings under Preferences/Options (
about:preferences
as address) should do the trick (if it doesn't it is a bug and it should be reported as such).Example for a deb file:
If the setting is to save, the file will be saved in Downloads or a selected location; if the setting is to open with an application, the file will be first saved anyway in a temporary location and then opened. If no program appears selected upon download try the above setting; if that doesn't work, try the below solution.
For the third case
(on how to make Firefox downloads list open a file in a desired application):
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: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:
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 underabout: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 should go to Edit ▸ Preferences ▸ Applications and decide what Firefox should do with every kind of files available. You can choose it to open with a certain application or to ask what to do.
That's the easiest, one click-way of doing it. Or you can use the dialog that appears (an that you have showed here), choose an application to open it and enable
Do this automatically for files like this from now on
. Next time you open one of these files it won't ask you again.But I recommend the first solution.