How to Hack Firefox Add-ons - MacMod:LIVE Episode 53
the JoshMeister demonstrates how to hack Firefox add-ons to work with the latest version of Firefox.
Hey, everyone! This is the JoshMeister, and welcome to this special video tutorial edition of MacMod:LIVE. With the recent release of Firefox 3.5, and since inevitably any major update to Firefox breaks a few perfectly good add-ons, I thought I'd show you how in most cases you can hack add-ons to force them to work with current and future versions of Firefox.
I use an add-on called LongURL to preview the full URL to which a shortened URL, such as a TinyURL link, will take me if I click on it. This add-on was updated to a new version to make it compatible with Firefox 3.5, but unfortuantely the new version of LongURL has a bug that prevents it from working. The old version worked just fine before updating Firefox, so I figured I'd modify the maximum version number string within the add-on and see if I can get the old version to work.
Let's go to LongURL's page in the Mozilla Add-ons directory, and let's click on the "See All Versions" link. Here's the old version that worked, so I'll right-click on the Download Now button to save the file to my hard drive.
In the Finder, let's locate the .xpi file we just downloaded. This is actually just a ZIP file in disguise, but unfortunately Apple's built-in archive utility in Leopard won't expand it, so I'll drag the .xpi file onto The Unarchiver, a freeware app. I've already done this prior to recording, so I have a folder here containing the .xpi file's contents.
Now we need to open install.rdf in a text editor. I'll use my personal favorite, TextWrangler. Now we need to look for the maxVersion string. You can see here that it's 3.0.* -- let's change it to 3.6.* and save the changes. You can change it to a higher version number if you wish.
Now in the Finder let's Select All, right-click, and select Compress (if I was using Tiger, it would say "Create Archive" instead).
Now I have a file named Archive.zip. Let's rename that, and make sure that the file has the extension .xpi so Firefox will know what to do with it.
Now we'll drag the .xpi file onto an open Firefox window, we'll get a dialog box to confirm installation, and then click Install Now. We'll now be prompted to restart Firefox, so let's go ahead and do that.
After Firefox launches, we see that 1 new add-on has been installed, and guess what? It's the 3.0-compatible version working in Firefox 3.5! Now we just need to make sure that it actually works. Let's go back to our Twitter page and hover over a couple of shortened URLs. It works!
Of course, I should give the disclaimer that this won't work for all add-ons -- don't expect your Firefox 1.0 add-ons to magically work in 3.5. Also, if you're going to try this, it would probably be a good idea to make a backup of your Firefox profile first, just in case something goes horribly wrong.
If you like living on the edge, or if you just like keeping tabs on the latest mods and ways to trick out your Mac, head on over to MacMod.com and subscribe to our RSS feed, or subscribe to our podcast at MacModLIVE.com. You can follow MacMod on Twitter at twitter.com/MacMod, or you can follow me at twitter.com/theJoshMeister.
Until next time, keep on modding!
http://macmodlive.com - Subscribe to this podcast! http://podcasts.thejoshmeister.com - the JoshMeister's other podcasts http://social.thejoshmeister.com - the JoshMeister's other social networks (YouTube, etc.)