How to write Greasemonkey scripts

by on March 5, 2006 · 11 comments· LAST UPDATED November 14, 2006

in , ,

Greasemonkey is a Mozilla Firefox extension that allows users to install scripts that make on-the-fly changes to specific web pages. Greasemonkey can be used for adding new functionality to pages.

Most Greasemonkey user scripts are written by hand, using site-specific JavaScript code which manipulates the contents of a webpage using the Document Object Model interface

Dive Into Greasemonkey is a book about programming with Greasemonkey, a Firefox extension for customizing web pages. According to this book "Greasemonkey is a Firefox extension that allows you to write scripts that alter the web pages you visit. You can use it to make a web site more readable or more usable. You can fix rendering bugs that the site owner can't be bothered to fix themselves. You can alter pages so they work better with assistive technologies that speak a web page out loud or convert it to Braille. You can even automatically retrieve data from other sites to make two sites more interconnected."

The book covers installation of Greasemonkey to various Advanced Topics. I find it very helpful. This book, its sample code are under terms of the GNU General Public License.
=> Download PDF Version (167K)

=> Download HTML Version (253K)

=> Read online.

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 11 comments… read them below or add one }

1 Shane November 15, 2006 at 2:06 am

Yea greasemonkey is pretty awesome in the right hands. But you put it in the hands of Jason Calacanis it can be downright eveil. Its no secret I can’t stand jason calacanis. I rant about him all the time on < DELETED dead url by admin >

Reply

2 tim July 15, 2011 at 8:19 pm

url fail. at least his (domain) still exists. lol

Reply

3 _asais November 18, 2006 at 7:17 pm

Didn’t know about these Greasemonkey scripts, but is sounds like something interesting :)

Reply

4 Heinz The Man June 16, 2008 at 3:23 pm

If you install IE7 Pro which is an add on for Internet Explore, you can also get greasemonkey scripts for IE7.
Besides you get a lot other, like adblocker and so on.

// Heinz The Man

Reply

5 Zhe Jerman May 18, 2010 at 6:47 pm

Installing IE7 is like putting a beetle engine in a Porsche

Reply

6 Dan May 21, 2010 at 12:25 pm

Greasemonkey is my new toy in the cyber world. :D

Reply

7 Hari September 23, 2010 at 12:25 am

In section 2.3, the reason the “bad example” doesn’t work is because it passes a dynamic javascript snippet instead of the function itself. In other words, instead of using the anonymous function, it can as well be written as “window.setTimeout(helloworld, 1000)”. BTW, the timeout is in milliseconds, so it should be 1000, not 60.

Reply

8 rudraksha September 22, 2011 at 9:20 am

It rocks. Very good work.

Reply

9 TK December 18, 2011 at 4:48 pm

The links are most assuredly broken.

Reply

10 Sudofox September 8, 2012 at 8:43 pm

Maybe we could fix them with a greasemonkey script.

Reply

11 Dr Talk September 28, 2012 at 10:40 pm

Can someone please provide a working link to the file? PUHLEEEEEEZE!!!

Reply

Leave a Comment

Previous post:

Next post: