≡ Menu

How to write Greasemonkey scripts

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.

Share this on:
{ 11 comments… add one }
  • ShaneNovember 15, 2006, 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 >

    • timJuly 15, 2011, 8:19 pm

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

  • _asaisNovember 18, 2006, 7:17 pm

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

  • Heinz The ManJune 16, 2008, 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

  • Zhe JermanMay 18, 2010, 6:47 pm

    Installing IE7 is like putting a beetle engine in a Porsche

  • DanMay 21, 2010, 12:25 pm

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

  • HariSeptember 23, 2010, 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.

  • rudrakshaSeptember 22, 2011, 9:20 am

    It rocks. Very good work.

  • TKDecember 18, 2011, 4:48 pm

    The links are most assuredly broken.

    • SudofoxSeptember 8, 2012, 8:43 pm

      Maybe we could fix them with a greasemonkey script.

  • Dr TalkSeptember 28, 2012, 10:40 pm

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

Security: Are you a robot or human?

Leave a Comment