Tuesday, March 29, 2011

Make your old add-ons work with Firefox 4.0

Every major release of Firefox brings the joy of great new features, along with the frustration of having plenty of add-ons that no longer work. Fortunately, it's quite easy to get most add-ons to work just fine with Firefox 4.0, even if they are not maintained or updated.


Add-ons not updated for Firefox 4.0

Add-on description

In an earlier post, I described how Firefox add-ons work. The important part is that each plugin must mention which Firefox version it can work on. This information is stored in the file named install.rdf, within the minVersion and maxVersion tags.

In order to work with Firefox 4, the maximum version number must be 4.0 or 4.0.*. The full list of possible version numbers is available on Mozilla's site. New versions are added only a few weeks or days before they are made available to the public. Even if a plugin author is pretty sure his add-on will be compatible with future 4.x versions (4.1, 4.5, etc.), he is allowed to list 4.0.* only.

So, with every major version of Firefox, all plugin authors have to update the maximum version. This means releasing a new version of the plugin. If the plugin is hosted on the official Mozilla add-on website, there is a nice web interface to easily update the version number.

Tool for authors to easily update an add-on

But if the add-on is hosted outside of the official site, a new release, meaning a new XPI file, has to be released.

If the plugin is not maintained anymore, Firefox will refuse to enable the plugin, even though it would very likely work just fine...

Fix your existing plugins

You can force old plug-ins to work with a newer version of Fireox by modifying the local install.rdf file. All plugins are stored in the user profile at the following locations:
  • Wndows: C:\Users\XXX\AppData\Roaming\Mozilla\Firefox\Profiles\xxxxxx.default\extensions\
  • Linux: ~/.mozilla/firefox/xxxxxx.default\extensions\
Each add-on is stored in its own sub-folder. Open install.rdf for the plugin you want to enable, look for the tag em:maxVersion, and change its value to 4.0.*. Restart the browser, and the add-on will be enabled.

Modify the em:maxVersion value
Then, do the same in extensions.rdf.

Some plugins may need code changes to work with version 4 (like Firesheep), but most of the plugins I upgraded (Live HTTP headers, etc.) worked just fine with Firefox 4.0.

Install "old" plugins

The same trick can be used for plugins you want to install. Firefox add-ons are distributes as .xpi archives. They are just Zip files. Save the plugin locally, open it with Windows Explorer or any Zip manager and then modify the install.rdf by changing the em:maxVersion to 4.0.*. Open the modified .xpi file in Firefox, and the add-on will be installed just fine.

Don't postpone your upgrade to Firefox 4.0 because of unmaintained add-ons. Modify the install.rdf and enjoy the great new features of version 4.

-- Julien

4 comments:

Anonymous said...

Mac OSX: Library/Application Support/Firefox/Profiles/xxxxxxxx.default/extensions/

nice trick!

Nilesh Kumar said...

But I can't find the following path: Wndows: C:\Users\XXX\AppData\Roaming\Mozilla\Firefox\Profiles\xxxxxx.default\extensions\ on Windows XP.
Not even under Documents and Settings, how to go there?

Regards,
Nilesh
http://nileshkumar83.blogspot.com

Nilesh Kumar said...

But I can't find the following path: Wndows: C:\Users\XXX\AppData\Roaming\Mozilla\Firefox\Profiles\xxxxxx.default\extensions\ on Windows XP.
Not even under Documents and Settings, how to go there?

Regards,
Nilesh
http://nileshkumar83.blogspot.com

Julien Sobrier said...

This is in your Home folder, for example c:\Users\Julien for me. The AppData folder might be a hidden folder on Windows by default. Go to Folder Options > View (2nd tab) > Hidden Files > select "Show hidden files, folders and drives".