Ubuntu – Firefox application associations not working in the ‘Downloads’ window

file associationfirefoxmime-type

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?

Best Answer

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.)

Related Question