UKUUG home

UKUUG

(the UK's Unix & Open Systems User Group)

Home

Events

About UKUUG

UKUUG Diary

Membership

Book Discounts

Other Discounts

Mailing lists

Sponsors

Newsletter

Consulting

 


 

Greasemonkey Hacks

Mark Pilgrim
Published by O'Reilly Media
ISBN:0-596-10165-1
495 pages
£ 17.50
Published: November 25, 2005
reviewed by Greg Matthews
   in the June 2006 issue (pdf), (html)
bookcover  

This is another publication in the informal O'Reilly ``hacks'' series, one that in my opinion has never lived up to the early promise of ``Linux Server hacks'' by Rob Flickenger. Mark Pilgrim is a good choice for the editor of this book, he is the author of ``Dive into Python'' from APress and diveintogreasemonkey.org, a comprehensive online introduction to this Firefox extension.

Trying to describe exactly what Greasemonkey is to someone unfamiliar with the way that web pages are rendered is difficult. However, this tool is written by and designed for the sort of people who have already got their hands dirty messing around with web servers and browsers. Greasemonkey installs as a Firefox extension but offers no new Firefox features or chrome by itself. Instead, it provides a means to write or install scripts that can alter the web pages you visit. This might include increasing the usefulness of a site, adding alternative search engines to the Google site for instance; or fixing annoying bugs, such as that website that insists you use Internet Explorer for no good reason. The scripts themselves are JavaScript and the first 12 ``hacks'' in the book are in fact a very brief introduction on how to write Greasemonkey scripts. The next 88 hacks are roughly divided into chapters by topic.

Initially, Greasemonkey appears to be a tool looking for a problem to solve. Sure you can do some clever tricks with it and if you need to use a particularly annoying website a lot you might be frustrated enough to hack something together to fix it. Generally though, if a particular site doesn't really fit the surfers requirements, she surfs on somewhere else. In other words, Greasemonkey scripts seem to be too much work for little return.

So as you listlessly leaf through this not insubstantial book (over 450 pages), idly wondering if anyone has copied code off the printed page since the demise of the ZX Spectrum magazines, you might just happen across the answer to the thing that has bugged you most about a particular website. For me, it was the first ``proper'' hack of the book, ``#13 Turn Naked URLs into Hyperlinks''. This incredibly simple (~20 lines) script simply makes non-marked up URIs clickable. Great. This encouraged me to read further and find one or two more that might be useful to me. Each hack is broken up into a brief section on the problem followed by the code (save lots of typing by finding the appropriate section of http://hacks.oreilly.com/), and then some notes on how to use it.

All in all, this book is an interesting demonstration of the potential for Greasemonkey. Most of the aptly named hacks simply scratch a particular hackers itch. This of course, is the classic Free Software development model. There will probably be something here to catch the eye of most readers but not enough to warrant the purchase. The problem is that Greasemonkey (and by extension, this book) is aimed at existing hackers who want to tweak their browsing experience. These people are either already using Greasemonkey or will be up and running and searching the web for scripts before this book arrives from Amazon or whichever bookseller offered the cheapest price when they used hack #94 ``Compare Book Prices'' (seven pages of code including base64 encoded PNGs). The contents of the book are really much better suited to a dynamic media like a wiki. It might be worth buying this for an aspiring young hacker or even your LUG library, but consider that the content will quickly become dated.

Back to reviews list

Tel: 01763 273 475
Fax: 01763 273 255
Web: Webmaster
Queries: Ask Here
Join UKUUG Today!

UKUUG Secretariat
PO BOX 37
Buntingford
Herts
SG9 9UQ
More information

Page last modified 02 Apr 2007
Copyright © 1995-2011 UKUUG Ltd.