I’ve just gotten a copy of Greasemonkey Hacks and I’m working my way through it. The book itself is great. It’s a really good introduction to greasemonkey and what you can do with it. Eventually, I’m hoping to may my bank usable in firefox.
The only quibble that I have is the code samples. Many of them (and they appears to be the ones written by Mark Pilgrim, the author) are really difficult to read, because they idioms are wrong. For example, nearly every for loop I have seen looks like this:
for (var i = arTableRows.length - 1; i > = 0; i--) { ... }
Which is walking through the rows of a table, backwards. Why backwards? I have no idea. I would expect it to look more like this:
for (var i = 0; i < arTableRows.length; i++) { ... }
Aside from a marginal efficiency gain (which smacks of micro-optimisation), I don’t see what the benefit is.
And “arTableRows” is another quibble with the code. It’s filled with hungarian notation. Great if you work at Microsoft, but unreadable to the rest of the world.