Greasemonkey is a Firefox add-on/extension that allows you to install userscripts that alter the web pages on the fly when you visit them. There are innumerable uses of Greasemonkey. It can be used to fix rendering bugs, add new functionality to web pages, breaking captchas, aggregate data from multiple web pages etc. In this how-to Guide you’ll learn how you can start using Greasemonkey userscripts in Firefox.
Installing Greasemonkey in Firefox
Before installing and using userscripts, you have to first install the userscripts interpretor in the Firefox, which is the Greasemonkey add on. Here’s step by step procedure to install Greasemonkey in Firefox -
1. Go to Greasemonkey page on the Firefox add-ons site and click on Add To Firefox button.
2. A new pop up dialog box will appear on which the Install Now button will be deactivated, to prevent you from a security vulnerability. It will be activated automatically after about three seconds seconds. Click on Install Now button to start the installation of Greasemonkey.
3. After the installation, the installer will ask you to restart the Firefox. Click on Restart Firefox button to do this. After the Firefox starts, a confirmation dialog will be shown that 1 new add-on, that is, Greasemonkey, has been installed. Look at the lower right corner of Firefox now. You’ll notice a small monkey icon there indicating that the Greasemonkey has been installed and is ready to work.
Understanding UserScripts
The Greasemonkey plugin, by itself, does nothing. You will notice no change in the behavior of Firefox after installing Greasemonkey. All its functionality comes only after installing appropriate userscripts.
A userscript is basically a JavaScript file that ends in .user.js extension and follows some specific syntactical conventions. Every userscript is written to do a very specific purpose, when installed in Firefox, with Greasemonkey plugin installed. You can browse through thousands of userscripts at Userscripts.org.
Installing Userscripts From Web
To install a userscript in Firefox, first make sure that Greasemonkey add-on is installed (obviously). Then click on the link on the web page that points to the userscript.
For example, if you are installing user script from userscripts.org, simply click on the link that says Install,
This will open the installation dialog box of Firefox. Click on Install button to complete the installation of the userscript.
Note – On the install dialog box there are a few more things, like the include and exclude rules, the Show Script Source button etc. These things are for userscripts developers and you can use userscripts easily without knowing anything about these things. Just keep the default options selected!
Troubleshooting Userscripts’ Installation
Sometimes the install dialog box is not displayed on clicking the userscript link. In this case, one of the following cases will be applicable to you,
1. The userscript’s source code is displayed in a new tab with a pop up install button, like this,
If this is the case, just click on the install button on the install button pop up bar to complete the installation.
2. Sometimes, on clicking the userscripts’ link, the script simply open in a new tab with no pop up install bar, like this,
In this case, click on Tools > Greasemonky >Install User Script to install this userscript.
Installing Userscripts From Your Computer
You can install the userscript from web only if the URL of the installation link ends with .user.js extension. If it doesn’t ends with this extension then the Greasemonkey plugin will not detect this script, and won’t display any of the installation options described above.
If this is the case, then save the userscript on your computer (File > Save As) and rename it as anyNameYouLike.user.js. Then right click on the file and click on Open With > Firefox. If you are on Linux, then just open this script using the File > Open dialog of Firefox, and click on the install button on the pop up bar to finish the installation.
Again, like above, if the pop up bar with an install button doesn’t appears, then click on Tools > Greasemonky > Install User Script to install this userscript.
Now that you know all about installing and using Greasemonkey userscripts in Firefox, visit Userscripts.org to check out all the available userscripts. If you don’t want to browse through the thousands of available userscripts, then just subscribe to Hacktrixto get notified about really cool userscripts, whenever they are released.