O'Reilly logo

Greasemonkey Hacks by Mark Pilgrim

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required


About the Author

Mark Pilgrim is an accessibility architect by day. By night, he is a husband and father who lives in North Carolina with his wife, his two sons, and his dog. He spends his copious free time sunbathing, skydiving, and reading Immanuel Kant’s The Critique of Pure Reason in the original Klingon. This is his first O’Reilly book.


The following people contributed their hacks, writing, and inspiration to this book:

  • Jesse Andrews is a developer who stumbled upon the Internet a few days ago. When conscious, he can be found spouting the virtues of Ruby on Rails, JavaScript, and wearing socks with sandals. You can rummage through his latest projects at http://overstimulate.com or have him rummage through yours at http://voltaiccommerce.com.

  • Albert Bachand

  • Michael Bolin is a software engineer at Google. Before coming to Google, he was a student at MIT, where his master’s thesis, End-User Programming for the Web, won the William A. Martin Memorial Thesis Prize in computer science. The thesis introduces an extension to JavaScript called Chickenscratch that is designed to enable end-user programmers to script web pages. The language and development environment are bundled as a Firefox extension called Chickenfoot that has similarities to Greasemonkey. Michael holds master’s and bachelor’s degrees in computer science from MIT.

  • Aaron Boodman is a 26-year-old web developer from Southern California. He wrote Greasemonkey in November 2004 in a fit of frustration with web pages that didn’t work correctly. He expected his five closest friends to use it in the best case. When he isn’t obsessing over a current project, he’s probably moving. In the past five years, he has lived in Orange County, L.A, Atlanta, Queens, the East Village, Seattle, and San Francisco. The most reliable place to find him will always be at http://youngpup.net.

  • Julien Couvreur is a developer for Microsoft, in the MSN division. There he worked in Passport, mainly on the authentication and bot prevention, and then joined the MSN Business Intelligence team. Julien is greatly passionate about the possibilities of the Web and especially has lots of fun with Greasemonkey. Originally from France and after spending a year in a San Francisco in a now defunct startup (RedCart), he currently lives in the state of Washington with his lovely fiancée, Lina, and shares thoughts and software projects on his blog, “Curiosity is Bliss” (http://blog.monstuff.com).

  • Roberto De Almeida is a Brazilian oceanographer trying to understand how the South Atlantic Ocean interacts with climate. In his spare time, he likes to play with JavaScript, Python, and his dog.

  • Vasil Dinkov is a 22-year-old web developer living in Plovdiv, the second largest city in Bulgaria. He is finishing his BSc in Computer Sciences at the University of Plovdiv in 2005. He has been playing with web technologies since 1999. In 2003, he established his own company, Vadikom (http://vadikom.com) and transformed his hobby into profession. He adores spending his spare time with the love of his life, Vania, playing soccer with friends, and listening to Depeche Mode.

  • Chris Feldmann’s first computer was an Apple. He used it to play Lode Runner, and didn’t start learning to program until 20 years later. He’s a freelance web developer living in Brooklyn who just doesn’t have time to be reading Slashdot. Watch for him skulking the sidewalks in a Greasemonkey T-shirt, or contact him at http://www.axlotl.net. "¡Mas peligroso que mono con navaja!”

  • Jonathan Fenocchi (http://www.SlightlyRemarkable.com) is a freelance web developer based in Southern Texas. He works as a web and graphics designer and also does programming in PHP and JavaScript.

  • Matthew Gertner is the chief technology officer of AllPeers (http://www.allpeers.com). A Brit by birth, an American by upbringing, and a European by choice, he has spent the last 13 years living in Paris and Hamburg before finally settling in Prague. In his professional persona, he’s first and foremost a C++ software developer, although he has been wasting a lot of time lately writing frivolous Greasemonkey scripts. When not working, he is an avid cook and a dangerously obsessive player of backgammon and golf.

  • Joe Gregorio is President of BitWorking, Inc. (http://bitworking.com). He has over 13 years of software design and project management experience, working on a range of applications from embedded and webbased systems to Windows desktop applications. He is an active member of the syndication community and the author of the Atom API. He spends his free time exploring the limits of XML and HTTP. He holds a Master of Arts degree in mathematics from Dartmouth College and Bachelor’s degrees in mathematics and computer science from Eastern Connecticut State University. He maintains a personal weblog at http://bitworking.org.

  • Logan Ingalls is a web programmer, Linux administrator, and bad driver from Connecticut. When he isn’t sitting in front of a screen, he’s probably hiking the Appalachian Trail or trying not to burn dinner. His armchair complaints and newest half-done projects can be found at http://plutor.org.

  • Prakash Kailasa is a firm believer in Free Software and a student of Dynamic Languages.

  • Adam Langley

  • Stuart Langridge has been playing with the Web since 1994, and is quite possibly the only person in the world to have a BSc in Computer Science and Philosophy. When not working on the Web, he’s a keen Linux user and part of the team at the open source radio show LUGRadio (http://www.lugradio.org). He likes drinking decent beers, studying stone circles, and scripting the DOM, not necessarily in that order.

  • Johannes la Poutre has a fascination for all things innovative in engineering and practical science. After getting a Master’s degree in industrial engineering and having a short career in the professional advertising and media world, he switched to the front lines of Internet technology. Currently, he is the leader of web development team at a large Dutch ISP. In his spare time, he tries to keep a balance between his family, and mixing and mashing all things XML, JavaScript, and CSS just for the fun of it.

  • Anthony Lieuallen is a 25-year-old web application development specialist living in New York. His personal home page is available at http://www.arantius.com, and his resume can be found at http://portfolio.arantius.com.

  • Gervase Markham is a member of the Mozilla.org staff and part-time employee of the Mozilla Foundation. He is particularly interested in modern web development, usability, and security. He also enjoys football, writing his weblog “Hacking for Christ” (http://weblogs.mozillazine.org/gerv), and reorienting toilet rolls so the loose end hangs down at the back.

  • Evan Martin

  • Matt McCarthy

  • Jeff Minard, having worked in the tech industry since age 13, says it best: “Computers are just fun, ya know?”

  • Justin J. Novack is a systems administrator and an avid script hacker. He thanks everyone who contributes to the open source community. With them, many young and aspiring minds have learned tips, tricks, hacks, and entirely new programming languages. His recent scripting abominations can be found at http://scripts.slightlyinsane.com.

  • Leslie Michael Orchard is a hacker, tinkerer, and creative technologist who works in the Detroit area. He’s engaged to a very patient and understanding science genius girl, and they both live with two spotted Ocicats and two dwarf bunnies. On rare occasions when spare time comes in copious amounts, he plays around with odd bits of code and writing, sharing them on his web site named 0xDECAFBAD (http://www.decafbad.com).

  • Mihai Parparita is a software engineer at Google. In a former life, he was a Mac shareware developer while being a student at Princeton. He completely misunderstood the purpose of Greasemonkey and started to use it to add features to web sites, instead of doing simple hacks like he was supposed to. He writes about his Greasemonkey scripts and other hacks at http://www.persistent.info.

  • Dan Phiffer is a designer and web hacker from Los Angeles. For the past year, he has been working as a freelance web site builder and will soon start graduate school at NYU’s Interactive Telecommunications Program. Dan isn’t really sure where this web thing is headed, but he enjoys playing with technologies that challenge the read-only tradition of media.

  • Jon Ramsey (http://idlevice.co.uk) is a web developer living in Hertfordshire, United Kingdom. He is a founding member of PHP London (http://www.phplondon.org) and works on a few open source projects whenever he gets the chance. Greasemonkey has renewed Jon’s lapsed interest in JavaScript, which has the great benefit that a worthwhile project can be completed in a period that fits his attention span. When not messing around with web stuff, Jon enjoys writing music, traveling, and playing snooker very badly.

  • Jason Rhyley has been playing with the Web since 1995. Despite popular opinion, he feels that things are more exciting now than ever. A recovering child prodigy and lifelong autodidact, he lives at http://www.rhyley.org and resides in Charleston, SC. And yes, he’d love to work for you.

  • Timothy Rice

  • Jesse Ruderman

  • Britt Selvitelle is an open source software developer whose enduring loves include Ruby, JavaScript, Greasemonkey, all things Mozilla, and the entire Spanish language and cultures. He is currently most excited about the newly formed http://tr.emendo.us project. His rock-and-roll lifestyle can be observed in real time at http://lukewarmtapioca.com.

  • Gareth Simpson

  • Ben Tesch

  • Scott Turner has a Ph.D. in computer storytelling, won the ACM International Programming Contest in 1989, contributed Keystone Kops to Nethack, appeared at least 10 times in rec.humor.funny, and is the world’s foremost expert on Rail Baron (retired). He is the author of Platypus and, strangely enough, actually is a rocket scientist.

  • Simon Willison

  • Phil Wilson is a 25-year-old software developer from Bristol in the United Kingdom. His web site doesn’t have any cat photos, which makes him sad. You can check up on his feline-free lifestyle by visiting http://www.philwilson.org. This will make him happy again.

  • Sencer Yurdagül studies information systems, as well as life, the Web, and everything. He enjoys building and experimenting with server-side web stuff, yet he had not written a single line of JavaScript until he discovered Greasemonkey.

  • Carlo Zottmann (http://G-Spotting.net) is an application developer and geek at heart. He spends his spare time tinkering with web sites, Greasemonkey scripts, Firefox extensions, JavaScript, Python, Ruby on Rails, and (if it can’t be helped) PHP and Perl. By the time you read this, he will once again be trying to get a grip on his love for World of Warcraft. He lives in Munich, Germany, with his wife, Dana.


First and foremost, I would like to thank Aaron Boodman for creating Greasemonkey, for taking me seriously when I reported security holes in Greasemonkey 0.3, and for working many long nights and weekends to make Greasemonkey 0.5 both secure and backward compatible. Without him, this book would not exist.

Second, I give my undying love and appreciation to my wife, Dora, who went to bed alone far too many times while I stayed up and wrote this book.

Third, I thank the members of the Greasemonkey mailing list (http://greasemonkey.mozdev.org/list.html) for maintaining such a high signal-to-noise ratio. They make my inbox a happy place.

Finally, I will forever appreciate my editor, Brian Sawyer, for his obsessive hatred of the passive voice; my technical editor, Simon Willison, for showing me that JavaScript can be elegant as well as functional; and everyone at Perkins on Highway 64 for providing late-night comfort food, electricity, and friendly conversation.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required