LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Linux Answers > Applications / GUI / Multimedia
User Name
Password

Notices


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
Code:
/usr/lib/mozilla/plugins/libflashplayer.so:$
:$
1169092261000:1:7:$
Shockwave Flash 9.0 r31:$
Shockwave Flash:$
2
0:application/x-shockwave-flash:Shockwave Flash:swf:$
1:application/futuresplash:FutureSplash Player:spl:$
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>:<MIME>:<name>:<file extensions>:$

<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
Code:
3:audio/mpeg:MPEG audio:mp2,mp3,mpga,mpega:$
4:audio/x-mpeg:MPEG audio:mp2,mp3,mpga,mpega:$
to the end of the list, then change the 2 to a 4.

In full the new flash plugin would look like
Code:
/usr/lib/mozilla/plugins/libflashplayer.so:$
:$
1169092261000:1:7:$
Shockwave Flash 9.0 r31:$
Shockwave Flash:$
4
0:application/x-shockwave-flash:Shockwave Flash:swf:$
1:application/futuresplash:FutureSplash Player:spl:$
3:audio/mpeg:MPEG audio:mp2,mp3,mpga,mpega:$
4:audio/x-mpeg:MPEG audio:mp2,mp3,mpga,mpega:$
And probably cause problems as soon as you tried to listen to mpeg ;)


And that's it.

by reed68 on Sat, 2009-02-28 22:25
Cool. Have been having problems with Flash in Iceweasel. So, I deleted the pluginreg.dat files I found and restarted Iceweasel and flash is back.

Thanks.


  



All times are GMT -5. The time now is 05:44 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration