Dynamic Greasemonkey Scripts
A friend and I recently did some work for a client creating a small Greasemonkey script. Greasemonkey is a nifty little tool that lets you run custom scripts on webpages of your choosing. These scripts are written in JavaScript and are local to your machine, not served up from some remote server. They let you make changes to web pages on the fly, as if you got to write your own JS for that page. The GM script had to work for Firefox and Chrome. Firefox requires an extension, whereas chrome recognizes a GM script automatically. The task seemed pretty easy. We needed to dynamically create a GM script to be installed on the user's system. All a GM script really needs is some JS with a few special comment fields at the top of the script, and you're ready to rock and roll. No biggie I thought, I'll just hack up a quick PHP script to spit back the custom JS...no dice. It turns out that the GM plugin in Firefox and Chrome's auto-detection...