I'm trying to associate a specific action with a file type in Firefox 3.0.

When I go to Edit > Preferences > Applications, there is no way to add a file type, such as MP3. I can edit existing file types and their behaviours, but I can't add any new ones.

There are instructions that say to click Edit > Preferences > Content > File Types > Advanced button, but I think that's for a different version of Firefox, because it's not actually there in 3.0.

Is there a way to do this on the fly, when I click a link? Is there a clever extension that makes this relatively simple thing finally easy to do?

  • Does nobody actually know how to do this? – Neil Sep 27 '09 at 17:50
  • Good question, I looked into it couldn't easily find a way. My best guess now is that e.g. for mp3 some plugin automatically opens it. Perhaps you could find which it is (about:plugins) and temporarily disable that plugin, and then click on such a link again. – Jonik Sep 27 '09 at 18:16
  • (By temporarily disabling, I meant something like: find Firefox's plugin dir, move the specific plugin dll/so file elsewhere, restart Firefox.) – Jonik Sep 27 '09 at 18:18
  • @Jonik you can temporarily disable a plugin in Tools > AddOns. On the top row of icons, the rightmost is Plugins. Click a plugin to show the Disable button. Changes require a restart. – quack quixote Oct 4 '09 at 20:17

What you're looking for is the mimeTypes.rdf file in your Firefox's profile folder.

A word of warning before you go any further, the mimeTypes.rdf file is not meant to be directly edited by users, and if you mess up it could stop your Firefox working.

Where your profile folder is depends on what OS you're running, see here for how to find your profile folder: Firefox Profile Locations.

It is an RDF file, which is a type of data file similar in some ways to XML, but its heirarchy works differently, this does mean that if you're careful you can read and edit it with a text editor. MozillaZine's knowledgebase has an article on the mimeTypes.rdf file here. You'll want to read up on the RDF format (more than what's in the link I just quoted) because its not quite as simple as XML to just paste in a new line to do what you want.

| improve this answer | |
  • Superb. By adding to mimeTypes.rdf, I was able to make Firefox work with (coincidentally) XML files that have a weird extension, where it's preferable not to simply rename them to XML. Now, instead of asking whether I want to open (recursively!) or download the file, it renders it. – underscore_d Oct 28 '16 at 9:50

See here: http://kb.mozillazine.org/File_types_and_download_actions

Unable to set an automatic action

In some cases, you may not be able to set an automatic download action. This can occur when a misconfigured web server assigns an incorrect MIME type, such as "application/octet-stream", shown here in SeaMonkey 1.x or if the server assigns "Content-Disposition: attachment" to the file download, as shown here in SeaMonkey 1.x ( the MIME type of a downloaded file, and whether it should be handled as an attachment, does not appear in Firefox or in SeaMonkey 2). [4] [5] When this happens, the option to always perform the same action will either be "grayed-out" or, in Firefox, selecting the "Do this automatically" option will not seem to have an effect and you will again be asked what to do when you next encounter that file type (see below for related bug reports). There is little you can do in these cases because the problem is at the server end.


Adding a download action

MIME types that are not handled by plugins do not appear in the Download Actions listing unless you have previously encountered that type of file and checked the option in the "Opening" dialog box to "Do this automatically for files like this from now on", as described above. You cannot add new file types to the Download Actions listing in Firefox, as you can in Mozilla Suite/SeaMonkey 1.x. The Mimetype Editor/Download Actions extension provides the SeaMonkey 1.x "Helper Applications" interface, shown below, as a Firefox add-on.

It was so much nicer when they allowed us to add file types/actions.

| improve this answer | |

In firefox 74, the solution seems to be as for Firefox 60 (Thanks for that advice).

I wanted to add a handler for Zoommtg for the zoom meeting application. It seems that the zoom installer probably creates this tag, but only for the Mac user account that zoom is installed in (the administrator account). Trying to run the installer in a normal user account just resulted in the installer quiting (presumably because zoom.us was already installed). I added into handlers.json:


Then I went into Firefox preferences, and selected the zoom.us application to be opened. I then clicked on the zoom meeting link and got it to launch the right applications. Eventually, the saved file contained:




probably only the latter is actually needed.

| improve this answer | |

When you click on a link. Firefox open dialog windows and you can set association for that file.

Open with -> Browse (here you find application, that you want to associate) -> Do this automatically for files like this from now on. (check)

| improve this answer | |
  • That's not actually true, you're merely thinking of how non-associated file types work in Windows. If I click on an mp3, for example, it starts playing it in the browser. There doesn't appear an easy way to change that. – Neil Sep 24 '09 at 15:25
  • @Neil. But that depends; if I click on an mp3 link, a "What should Firefox do with this file?" dialog opens. – Jonik Sep 27 '09 at 18:14
  • I agree with MicTech. At least on my setup, I have two MPEG Layer 3 Audio (aka MP3) options that I can customize. So, if an extension is not already associated you get the "open file" dialog, and if it is already associated, you customize it through the associations window. – Chrisbux Sep 27 '09 at 18:46
  • Where is the "associations window"? – Neil Sep 28 '09 at 17:44
  • 1
    Sorry - I meant the "Applications" screen under options. – Chrisbux Sep 28 '09 at 22:01

It's not exactly what you're after, but the Firefox Launchy extension makes it pretty easy to right click on links and choose what program to send an mp3 file to, etc.

| improve this answer | |

In Firefox 60, what worked for me was to edit the json file handlers.json in my profiles folder. First, make a backup of the file, and then look for the stanza mimeTypes. Copy an entry within that stanza and use it as a template for your entry.

In my case, I wanted gzip files to be downloaded instead of being opened in an archive viewer, so I inserted

"application/gzip": { "action": 0, "ask": true, "extensions": [ "gz", "tgz" ] },

That turned out not what firefox wanted to read, and in my case firefox silently fixed the stanza to read:

"application/x-gzip": { "action": 0 } },

As a bonus, firefox added an entry for the new mimetype stanza in the about:preferences list of handlers.


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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