While browsing online the other day, I came across a conversion tool which allows you to take a Greasemonkey script and turn it into a "xpi" Firefox extension.

firefoxextensions.gif

It's entitled "User Script Compiler" and it is very easy to use. Turning Greasemonkey scripts into proper Firefox extensions is all the rage at the moment. Gina Trapani over at Lifehacker has taken all the best Greasemonkey scripts (with permission of course) for Google products such as Gmail, Google Reader, Google Calendar and YouTube, and merged them all into Firefox extensions. Now you can do the same - even if you don't have any programming knowledge.

First, you need to get the actual Greasemonkey script. Go to your Firefox profile in your Windows Explorer and find the "gm_scripts" sub-folder. This folder contains all the Greasemonkey scripts that you have installed on your Firefox browser and should all be in javascript file format (.js). Alternatively, you can download some scripts from Userscripts.org. Or check out previously posted '20 must-see Greasemonkey Addons'

Now right-click on the desired script, choose "rename" and turn the file from javascript to a text file (.txt). Open the text file and you have your code. Then go to the User Script Compiler and enter the required information in the fields provided.

Turn Greasemonkey Scripts into Firefox Extensions

I just copied and pasted the entire contents of the text file into the User Script field. If you want to add the developer's name and so on, you can normally find it at the beginning of the text file. Then when all fields are filled, press the "compile" button. An XPI file should now be generated for you onto your computer. That's your new Firefox extension.

To install it onto your Firefox, you have to click on it with your mouse and drag it from your Windows Explorer onto the Firefox browser page. The regular installation box will then open and you should then install it as normal, like any other extension. Close and restart Firefox and your extension should now be there. Try it out to see if it works. I tried it on three different Greasemonkey scripts and they work flawlessly.

Oh and don't forget to delete the original Greasemonkey script which is now not needed! If you're feeling nice, why not email the script developer and send them a copy of the new Firefox extension file?

You're probably asking by now what the advantage is of doing all this. Isn't a Greasemonkey script and a Firefox extension essentially doing the same thing? Well yes but if you're say a programmer / developer or just someone who wants to pass on a good script to someone else, converting those Greasemonkey scripts into full Firefox extensions is beneficial if you want to get them out to a wider use base. I mean, everyone "gets" Firefox and extensions but try explaining the finer points of Greasemonkey to someone who can barely grasp the concept of programming. It's much easier to point them to an extension and say "click on that". If they have to install the Greasemonkey extension and then the script, they would probably not bother.

Are there any other Firefox compiler tools out there that we should know about?