Monday, 9 May 2005
Greasemonkey and the Web
There’s a lot of cool apps emerging for GreaseMonkey (and GreaseMonkIE and PithHelmet, for IE and Safari respectively). It seems like these extensions have a love/hate relationship with the Web, philosophically.
On the one hand (with L O V E sprawled across the knuckles), GM is a great example of taking advantage of the representational nature of the Web. SOAP-heads would call this “loose coupling” or “document-oriented.” The fact that you can rock up and modify somebody else’s content to suit your purposes and/or tastes is a direct result of this.
On the other hand (the one bearing H A T E on its phalanges), GM is a browser plug-in that you have to download and install, and then you need to download (or write) extensions and configure them for your browser. This means that if you use another browser or machine, you either have to go through it all again, or lose your modifications. If you want to share what you do with someone else, you have to hold their hand through this entire process.
In other words, the Web was built by having as little client-side state as possible. Keeping GreaseMonkey and all of the scripts people use up-to-date is a management nightmare that the Web solved a long time ago.
So, while GM is fine for geeks (who are always willing to install more software), it doesn’t work too well for normal people. URIs and browsers are built to make it easy and fuss-free to get what you want; downloading multiple pieces of software and cooking up a recipe to get them to act like you want seems more reminiscent of FTP than the Web.
A More Web-like GreaseMonkey
The obvious Web-like way to interpose services is through intermediaries (proxies and gateways).
A GreaseProxy would act like a normal HTTP proxy; you’d configure it in your browser and then forget it. Using HTTP proxy authentication, it would remember who you are, and what extensions/modifications you’ve requested (through a configuration page on the same server as the proxy), modifying your HTTP traffic as it went by.
For casual modification of pages, a GreaseGateway will do the trick, much in the same fashion that CritSuite and countless other services work today; a central Web page with a list of available services and maybe a bookmarklet would make it easy to use.
The great thing about this is that GreaseProxies could be deployed in a company, on the open Internet for a fee, and even on your own machine for when you’re on the road; you’d be able to share services between colleagues, friends and your different browsers. For example, a company could deploy a proxy that allowed employees to mark up Web pages, CritSuite-style.
Probably the biggest barrier to such things getting adoption is that proxies and gateways aren’t exactly developer-friendly; it’s a lot easier to fiddle with a browser extension when you’re getting something right, and that’s why GreaseMonkey has so much interest. That’s why GreaseProxies and GreaseGateways should accept an existing GreaseMonkey script with no changes, so they can leverage GM’s popularity and give us the best of both worlds.
Anybody want to start coding?
* People Who Know tell me that the majority of proxies in the world today are sold to be used “transparently” (that is, without browser configuration), so this is an increasingly small problem. Someone who does need a proxy could either chain a GreaseProxy in front of the access proxy, or use a GreaseGateway.