Joey’s Linux Scams

Installing, setting up, and using Greasemonkey

Posted by: Joey on: December 19, 2006

I’m sure by now all you Firefox aficionados have heard of a little addon extension called Greasemonkey. I’ve also seen some frustration associated with the installation and use of Greasemonkey. Since I also shared this frustration, I decided to put together this little tutorial. Leave feedback in the comments section.

Installation

We’re assuming you have a functioning copy of Firefox 1.5 or better. If not go download it here. Next you will need to install the Greasemonkey extension. Restart Firefox to complete the installation. In Firefox 2.0 there should be a button in the installation dialog box that will automagically restart Firefox and restore your session as if Firefox had never been closed. Once installed properly there will be a small Greasemonkey icon in your status bar and there will also be a menu option under the Tools menu.

Pretty neat and simple so far! However, I have a sneaking suspicion most of you have made it this far already.

Configuration

Once installed properly there is still one more important piece of setup to do. You have to set the text editor. There are a couple of ways to do this.

The nerdy way to set the text editor is to open a new tab and navigate to your about:config page. In the about:config page there will be an entry called greasemonkey.editor. Right click on this entry and select Modify. Enter the path to your favorite text editor here. In Ubuntu Linux this path is /usr/bin/gedit and for Windows losers… I mean users, the path is c:\windows\notepad.exe or whatever the path is to your favorite text editor.

The mouse clicky way to do this only works if you’ve never set the text editor before (either intentionally or unintentionally). On your freshly installed Greasemonkey, right click on the status bar icon or click on Tools > Greasemonkey > New User Script. This will open a dialog box that will allow you to select your text editor.

Note: New User Script is for WRITING scripts, NOT installing them. Unless you write your own Greasemonkey scripts, you’ll probably never click on New User Script again. If you’ve previously tried to install a .js file using New User Script, it has set that .js file as your default editor. You’ll have to use the nerdy text editor setting method mentioned above to correct this. Once you have a properly configured text editor option, clicking on New User Script will simply open the text editor. Personally I think they should rename that option Script Editor or Text Editor to avoid a lot of confusion.

Installing scripts

Installing of scripts in Greasemonkey is easy, but non-intuitive. First, remember that all Greasemonkey script filenames must end in user.js and typically they are named <script-function>.user.js. You have to surf to the script to install it. Once you do that, Greasemonkey will go ahead and install it automatically. If a file is stored on your local computer, go to File > Open File… to select and open the file. Again, Greasemonkey will automatically install the script once you’ve done this. Surf to http://userscripts.org/ to find a comprehensive and searchable list of millions of scripts.

Managing scripts

Once you have scripts installed, you be able to enable, disable, uninstall, and edit them from the Manage User Scripts dialog. To get to the Manage User Scripts dialog, right click on the Greasemonkey icon in the status bar and select Manage User Scripts…, or go to Tools > Greasemonkey > Manage User Scripts…. Once inside you can turn the scripts on and off and uninstall or edit them. You can also select an include or exlcude list for each script. To make the script apply to all websites, click on the script in the left hand column and put a * in the includes list. To make a script only work for one website, for example Google, select the script in the left hand column and put http://google.com/* in the includes list. Use the same method for the excludes list if you don’t want the script to run on certain web pages.

Conclusion

I hope that this little tutorial helps some of you out. Greasemonkey is a neat feature and sometimes and invaluable tool. Let me know if you have any suggestions for this tutorial. Have a lot of fun!

11 Responses to "Installing, setting up, and using Greasemonkey"

[b]i like dat…!!!
wellll “gm” make d scripts easy to handel…
rather dat compling tp xpi format…!!
c’ya
biiiiiiii,,,!!

Thank you for the effort.
I hope PROs like you follow this goal to help NON-PRO users.

nice website and nice info.

ay man i still can’t do it. greasemonkey is a file dat is unknown format how do i use it? do i paste it somewhere or wat.?. hey im a sort of a computer beginner but a quick learner so start in detail wit the begining. i still don no about greasemonkey and where or how to install it. please help cus i found some interestin clips from youtube. thanks man. laterz

hey thanks this worked for me..Where I went wrong was installing the .js to the mew script instead of opening..that changed my config and screwed it all up…Man, Thanks so much, you really saved the day/

I recently installed a greasemonkey script to version 0.6.6.20061017.0, and suddenly ALL of my scripts disappeared. Now, when I try to reinstall scripts that I’ve installed before, I get the famed

[Exception... "Component returned failure code: 0x80520008 (NS_ERROR_FILE_ALREADY_EXISTS)
[nsILocalFile.copyTo]” nsresult:”0×80520008 (NS_ERROR_FILE_ALREADY_EXISTS) location:
“JS frame :: chrome://greasemonkey/content/config.js :: anonymous :: line 148″ data:no]

error. I tried fixing the editor in the about:config, I’ve tried uninstalling and reinstalling greasemonkey, I’ve followed the directions on this site – still no dice. My next step is to uninstall and resintall Firefox. Any help before that?

Nice work — but as Windows user, I changed to the “DOS” type of path to set my editor, so instead of “C:\Program Files\FolderName\program.exe” — I used “c:\progra~1\foldern~1\program.exe” – that set the text editor to finally work okay.

But still, no scrips install. Using 0.6.6.20061017.0 — I get the “countdown” to enable the Install button, then I click on it, and nothing happens. Can’t do it either via File…Open to open the properly named .js file I’ve saved locally. Maybe I’ll need to wait for a new version of Greasemonkey to appear!

This was very helpful 5/5

I also can’t get the install button to work. I’ve tried version 0.6.6.20061017.0 and 0.6.7.20070131.0

At this stage, I’m figuring I’ll just give up.

But, thanks. At least I know that clicking on New User Script isn’t supposed to be for installing a script.

maybe i can make it work now lol i stared to delete it , butt not yet , ok thanks have a great day

Great info, i appreciate the fact that u gave info about linux thing.

Leave a Reply