Posts

Showing posts from May, 2011

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 require that the file name

Welcome!

I guess I'm only welcoming myself for now, since nobody else reads this (yet).  It's about time I got one of these things going.  I still have no idea what direction this thing will take, but I might just let it steer itself and enjoy the ride.  I figure there will be a fair amount of techie stuff here, mostly revolving around C, embedded programming and maybe some PHP extensions.  Hobbies include brewing, surfing, working on cars and houses, so some of that will likely pop up.  And I like to follow current events, politics and economics, but on a somewhat light level, so you might see the occasional post about that.  I like to ponder math, religion, philosophy, literature and linguistics, so a bit of that might come up too.  Basically, nothing is off limits, but I'll try to keep it to polite dinner table conversation.  So check back from time to time, and hopefully you'll find something interesting.