Mark Pilgrim goes both ways

Amazon Affiliate Hijacker: Mark’s Greasemonkey script to rewrite all Amazon links to include your choice of affiliate ID.

Amazon Affiliate Anti-Hijacker: Mark’s JavaScript to include in your own pages, to rewrite all your Amazon affiliate links back to including your affiliate ID.

Both scripts have already been revised since I first saw them, a few hours ago, so there’s still plenty of time, but I really think it would be funnier if they were fighting a little more. The Greasemonkey script is giving in way too easily, only running at the DOMLoaded event when Greasemonkey runs, rather than registering an onload listener that can fight to run after any rewrite-back script runs. Then the anti-script can go back to its first style, saving off the existing onload and manually running it, and can then check again after running the rest of onload to be sure it hasn’t been overwritten. Though the Greasemonkey script would probably then just continually call itself on a timer on any page including Amazon links, like the anti-AutoLink script does.

Yeah, it’s sick that it amuses me this much. Yeah, I did play chess against myself when I was a kid (though that was only because my brother was so much older than me, and smarter than me, that I couldn’t figure out how he was cheating).


Comment by Mark #
2005-03-31 21:09:18

It went 6 rounds, until I stumbled upon the ultimate solution: how to completely disable all Greasemonkey scripts on your web site.

Knockout in the 7th round. Winner: content producers.

Comment by Phil Ringnalda #
2005-03-31 21:33:10