This is something that used to bug me occasionally with Firefox, and something that I've noticed quite a few people have complained about to me. You might know the problem- you update Firefox to a new version, and half your extensions refuse to work. Well, luckily there is something you can do about it.
You may also find this article interesting if you want to know how extensions fit together. This is basically how I learnt how to create the few extensions I have written (which are hacked together from code pulled from other extensions).
First up, you will need a copy of the extension. By that, I mean the file called something like extension.xpi. The best way is to find it when you originally installed the extension from, just right click and "Save As..." from the website.
Now, I'll let you in on a little secret about that mysterious filetype, xpi. Its nothing but a renamed zip! Thats right, one of the most commonly used compression formats. So all we need to do to start pulling the extension apart is to rename from extension.xpi to extension.zip, and then extract as any other zip file.
Now, once you have extracted the files you will notice a file called "install.rdf". This file contains all the basic information about the extension, such as the author, the version, and most importantly for this guide, the target application.
So lets look at the target application part...
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>1.5</em:minVersion>
<em:maxVersion>1.8</em:maxVersion>
</Description>
</em:targetApplication>
So we see 3 setting here, wrapped in a bit of XML. They are: id, minVersion and maxVersion. The nice long number in the id attribute is Firefox's unique identifer. Since extensions can be instaled on the Mozilla Suite, and Thunderbird, you may see more than one targetApplication section. The next 2- minVersion and maxVersion- dictate which versions of the application (in this case Firefox) the extension can be installed to.
So, if its not already obvious what needs to be changed, we need to modify that maxVersion setting. Set it to something that is the same or greater than the version that you have installed. Once you have done this, you can save and close the file. This is all you have to change, easy huh? Keeping the rest of the details the same will mean that once the author does their own update, the repackaged extension will be updated automatically.
Now that we have made the changes to install.rdf, we need to repackage the extension. Basically we just need to do the opposite to what we did in the first step. Compress the extension as a zip archive, then rename the new zip file to xpi. You now have your new extension, which will work on your new version of Firefox!
Now, you *could* go to the effort of creating your own HTML page to install the extension from, but you don't need to. Luckily, we live in the age of drag-and-drop, which is exactly all you need to do to install your updated extension. So drag it into Firefox, and it should prompt you to install or update much like it would installing from anywhere else. Restart Firefox when it is done and you should have a working extension!
While this technique will work most of the time, sometimes there are reasons why Firefox versions are unsupported. Most notably in major version jumps when the Firefox developers may change things that the extension relies on. I haven't stuck any situations where this has happened, but the possibility is there.
Thank you, I've been looking for such an article for some time .... thanks
Posted by Muhammad Haddad, 10/07/2008 5:24am (2 years ago)
RSS feed for comments on this page | RSS feed for all comments