Firefox application associations not working in the 'Downloads' window

15,558

Solution 1

UPDATE: Ever since Firefox 18, Firefox has GIO support instead of GnomeVFS support, so the workaround below shouldn't be necessary anymore. If anyone's still hitting this issue in recent Firefox versions, this will be unlikely to fix it.

So, take the rest of this post with a grain of salt...

The fix

This fixes it for me:

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

and finally, restart Firefox. When it comes up again, its Download Manager should invoke the correct program (as specified in the .list files referenced above).

Details

Firefox (up through trunk nightlies as of this post) currently uses GnomeVFS API to ask "What app should I use to open files with this mimetype?" However, GnomeVFS has become deprecated in favor of GIO.

Nautilus (I'm looking at ver 2.32.2.1) now uses GIO to register user-specified default handler-applications (like smplayer in your case). GIO and GnomeVFS use different files to manage their settings, but the files are apparently in the same format (at least similar enough for the above "ln" hack to work for me. :))

(I've investigated this in a bit more detail on a Mozilla bug report.)

Solution 2

Oddly, this topic seems still actual in 2018.

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.

Solution 3

To follow up to Peterling's solution, that worked for me. I was messing around with my mime types files forever trying to figure it out. Turns out that installing Nautilus on my Mint17 KDE system was the way to go. It strikes me as ridiculously convoluted that Firefox is looking at Nautilus settings on a system that does not even have it, but there you go. I'm running Firefox 33 BTW.

Share:
15,558

Related videos on Youtube

Pavlos G.
Author by

Pavlos G.

BSc degree in Computer Science. Working in the I.T. field for ~15 years (MCP, CCNA). Linux user for ~10 years (Slackware, Fedora, Debian, Ubuntu and now Mint) Love Gnome 2. Hate Unity and Gnome 3 :-D

Updated on September 17, 2022

Comments

  • Pavlos G.
    Pavlos G. over 1 year

    No matter what changes i make to file associations (actions) in the 'Applications' tab in Firefox, they're totally ignored.
    For example, i set .wmv and .avi files to open with 'smplayer' but when i download a file and double-click on it (through the 'Downloads' window), it keeps opening with Totem player.

    The default file associations through nautilus ('open with' tab) work fine, i.e. i've set smplayer as the default player and when i double-click a video file it open correctly.

    I've tried to delete and recreate mimetypes.rdf but that didn't help.

    Any ideas on what else should i check?

    • mckenzm
      mckenzm over 3 years
      Almost 10 years and no answers approach SELinux configuration yet.
  • Pavlos G.
    Pavlos G. over 13 years
    Unfortunately, I've already set the default application through nautilus to 'smplayer' and it works ok there. The problem only happens in firefox. As for the link you gave me, I've already checked it. It's exactly what I'm doing, but it just doesn't work....
  • Pavlos G.
    Pavlos G. over 13 years
    I've also updated my question so as to be as clear as possible.
  • Pavlos G.
    Pavlos G. over 13 years
    I've already said that I've deleted mimeTypes.rdf. Yet, nothing happens. When i double-click on a file, it just opens with Totem...
  • lovinglinux
    lovinglinux over 13 years
    Have you closed Firefox before deleting mimeTypes.rdf?
  • dholbert
    dholbert almost 13 years
    After digging a little deeper: I've found that Firefox has optional GIO support added in bug 402892, but it's currently disabled at build-time, by default. If you compile your own Firefox builds, you can enable it with the "--enable-gio" mozconfig build flag.
  • Pavlos G.
    Pavlos G. almost 13 years
    In my case, the defaults.list seems to be ok and the mimeapps.list seems to have some 'bad entries'. Nevertheless, your answer helped a lot. Thanks :-)
  • edA-qa mort-ora-y
    edA-qa mort-ora-y over 5 years
    Hmm, I've linked the mimeapps.list to defaults.list and I still get the wrong file being opening. :/
  • Akshat
    Akshat over 4 years
    I actually get the best results by removing all three of mimeinfo.cache, mimeapps.list and defaults.list.