LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 07-15-2007, 08:42 AM   #1
Tortanick
Member
 
Registered: Jul 2006
Distribution: Debian Testing
Posts: 299

Rep: Reputation: 30
Howto: edit the filetypes associated with a firefox/iceweasel plugin


I was searching all over the net for this, 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 encase anyone else was looking. Note that this doesn't allow you to extend a plugin to new fileformats, 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 labled "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 havn'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,
useing a flash 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 linebreaks 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 forth 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 diffrent formats associated with this plug-in, in this case its "2" If you add or remove any filetypes to a plugin, make sure you change the number accordingly.

The final two lines are both a filetype 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 encase. <MIME> is unsuprisingly the mimetype of the format. name can be anything you chose it's soul purpose is to appear in about:config. Finally file extensions, put as many as you like here with comma seperation.

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 probobly cause problems as soon as you tried to listen to mpeg ;)


And that's it. but a couple of finishing points:
On Debain and possibly others, the VLC plugin can play divx files (used by stage6.divx.com and others) but the plugin dons't have it listed by defualt, I added
Code:
26:video/divx:Divx video:divx:$
to fix that and it worked perfectly. I also remember a divx problem on mplayer that's fixed by symlinking something into the plugin directory, so if you're a debian mplayer user and can't get divx streaming working that may be it.

And this is the first time I wrote a guide like this, so I'd appreciate any comments you have on it.

Last edited by Tortanick; 07-15-2007 at 11:09 AM.
 
Old 07-16-2007, 06:04 PM   #2
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Guides and Tutorials go in the Tutorials section - when you are happy with this one, post it to the Tutorials section (link at top of page) and request this thread be closed. It avoids it being lost among all the other threads.
 
Old 07-17-2007, 01:41 AM   #3
Tortanick
Member
 
Registered: Jul 2006
Distribution: Debian Testing
Posts: 299

Original Poster
Rep: Reputation: 30
I never even noticed that section, thanks for pointing it out. I've submitted it so you can close this tread now.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
no audio for iceweasel flash player plugin dombrowsky Linux - Software 11 10-18-2011 06:27 PM
howto disable firefox plugin - gxine? ygloo Linux - Desktop 5 03-20-2009 10:23 AM
Can't install Firefox or IceWeasel on Kubuntu lumix Linux - Software 4 06-30-2007 11:10 PM
Firefox now iceweasel on Debian jstephens84 Debian 10 06-07-2007 11:03 AM
Iceweasel Bookmarks and Firefox okos Linux - Software 1 05-27-2007 02:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 11:28 AM.

Main Menu
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