I’m sure you guys all remember the promise of the web to free us from vertical lock-in and enable content to sanely migrate between all different contexts: several generations of web browsers, screen readers for the vision-impaired, dedicated internet appliances, mobile devices and even in automated user agent contexts.
To this end, web standards are evolving to separate presentation logic from display logic via XHTML and CSS. Good authors should attempt to structure their page to convey semantic relation between document elements and leave the presentation logic to CSS. The possibilities for what browsers/user agents can do with semantic web documents (especially via microformats) is best left to another post (or perhaps a more articulate author), but I would encourage you to investigate those links (and look around my del.icio.us) if my post intrigues you.
The key point to drive home is that there is no guarantee of control over what the end user does with a document, in terms of both its layout and content. Now, tools are available to transform the user experience of using a website to their requirements by reshaping aggregating content. In the past (the “Web 1.0″ era), there were a handful of technologies that allowed this sort of transformation:
- Filtering proxies, both censorware and things like Privoxy.
- User CSS in Mozilla/Firefox
- Ad blockers
- Pop-up blockers
- Those annoying Windows ad/spyware applications that rewrote web pages with “helpful” keyword links, etc.
- Bookmarklets (Please read this one)
Bookmarklets were the most interesting of all of these because of the low barriers to adoption of them.
- They don’t require a particular browser/platform to use. (Generally)
- They don’t require any server infrastructure.
- Bookmarklets compete on an equal playing field with the Javascript code executing in a page, having equivalent access to the page’s DOM and Javascript libraries as it itself does.
- There is no special software required to code/generate them, just a browser.
There’s a ton of interesting stuff you can do with these really. For an example, here is a bookmarklet that exposes microformats embedded in the current page. Try it. You can put a link to that javascript: url in your bookmark bar and try it on any page that supports hCard or hCal. There are more details of how it works which I recommend reading because this bookmarklet relies on a backend server (although many don’t).
Anyway, this whole “Web 2.0″ buzz seems to put a lot of stock in the idea of rich highly interactive applications using technologies like AJAX, where the fundamental metaphor for web interaction — the “page” — has been replaced by interactive widgets.
Side note: Good applications should still be using the page and its (hopefully) information bearing) URL as the fundamental method of navigation still. Applications without useful, informative and permanent urls (like Wikipedia does), may as well be desktop applications, as the ability to reference their component pages from other documents, the key feature of hypertext, does not exist. (End of side note)
Meanwhile, if you know anything about implementing an AJAX application, you’ll realize that the possibilities for manipulating a page to include AJAX interactions with a third party service are limited by the fact that web browsers only allow XMLHttpRequests to the server that the current page originated at. Never fear….
Solution: Greasemonkey (just read the link) Why is it awesome:
- Elimination of the domain restrictions on AJAX interaction, allowing for producing mashed-up pages from many sources like this:

- Automatic invocation of scripts, allowing entire sites to reap the benefits without manual interaction on every page. (Additionally, the rules of which pages to apply scripts to are in place)
- Beginnings of cross-browser support. Extensions exist for most Gecko/Firefox based browsers, Internet Explorer and Safari. Opera is now shipping Greasemonkey-style Userscripting support built-in. This will be very interesting if/when this trickles to Opera’s mobile / embedded browsers. It will be great to leverage this stuff on platforms neglected by plugin authors and site designers.
Anyway, I took the plunge and wrote my first script. It adds Myspace.com Blog RSS links next to user profile links as well as in a LINK tag in user profiles. From this:

To this:

Much nicer. You can see my Userscripts.org profile here. (Of particular interest to me are the scripts tagged ‘microformats‘.)