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.

ADVERTISEMENTS

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.

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source & DevOps topics via:
CategoryList of Unix and Linux commands
File Managementcat
Network Utilitiesdig host ip nmap
Package Managerapk apt
Processes Managementbg chroot disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w

ADVERTISEMENTS
11 comments… add one
  • Shane Nov 15, 2006 @ 2:06

    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 >

    • tim Jul 15, 2011 @ 20:19

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

  • _asais Nov 18, 2006 @ 19:17

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

  • Heinz The Man Jun 16, 2008 @ 15:23

    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 Jerman May 18, 2010 @ 18:47

    Installing IE7 is like putting a beetle engine in a Porsche

  • Dan May 21, 2010 @ 12:25

    Greasemonkey is my new toy in the cyber world. 😀

  • Hari Sep 23, 2010 @ 0:25

    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.

  • rudraksha Sep 22, 2011 @ 9:20

    It rocks. Very good work.

  • TK Dec 18, 2011 @ 16:48

    The links are most assuredly broken.

    • Sudofox Sep 8, 2012 @ 20:43

      Maybe we could fix them with a greasemonkey script.

  • Dr Talk Sep 28, 2012 @ 22:40

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

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.