Edit The Filetypes Associated With a Firefox/Iceweasel Plugin
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
By Tortanick at 2007-07-17 01:39
I was searching all over the net for how to associate additional filetypes with a Firefox plugin and I couldn't find out anywhere. In the end I figured it out myself mostly through luck and I thought I'd post it hear in case anyone else was looking. Note that this doesn't allow you to extend a plugin to new file formats, just change what plugin Firefox uses for what files.
It's actually very very easy, I just haven't seen it documented anywhere, you just edit the file ~/.mozilla/firefox/pluginreg.dat Be warned that pluginreg.dat is clearly labeled "Generated File. Do not edit.", however editing it has worked for me although that was immediately before writing this post. I've tested and my changes did survive the test deletion of a plugin, but I haven't tested anything else, so changes may magically vanish one day. On the plus side if you screw up delete the file and Firefox will regenerate it.
The syntax is very simple, or at least the part we will be editing is, using the Adobe Flashplayer for example
Annoyingly there are no line breaks to separate different plugins, but if you follow the syntax its clear where they begin or end.
The first line is obviously a path to the plugin, I have no clue what the second or third line is for, just leave them alone. The third line is the plugin's name that appears in about:plugins. The fourth line I don't know about either and there is no need to touch it.
Finally we get to the important part that one can edit to control one's plugins: the first line, is the sum total of the different formats associated with this plug-in, in this case its "2" If you add or remove any file types to a plugin, make sure you change the number accordingly.
The final two lines are both a file type associated with the Flash plugin, shockwave-flash and futuresplash respectively, the format for these entries is:
<number> should be 1 higher than the previous row, when I first looked at pluginreg.dat they were all in sequence, I'd keep them that way just in case. <MIME> is unsurprisingly the mimetype of the format. name can be anything you choose it's sole purpose is to appear in about:config. Finally file extensions, put as many as you like here with comma separation.
So for example if I wanted to tell Firefox to use the Flash plugin for mpeg audio (rather stupid but it makes a nice example) I'd add