Tuesday, January 18, 2011

Chrome apps and extensions

You follow good practices, archive your priceless material in standard formats, and make it accessible through network services. Now where do you build applications to use those services?

In digital scholarship, your time is your single most valuable resource, so the cost of a full-blown cross-platform desktop application is usually prohibitively high. As CSS 3 and javascript give Web browsers better and better support for visually rich interactive applications, the browser becomes more attractive as a platform for applications, rather than just a viewer for documents.

HTML5 clearly understands the browser this way. (If you're not familiar with HTML5 yet, see http://www.html5rocks.com/) The blogosphere is full of comments about HTML5's audio and video capabilities, but its integration of local and networked resources raises more interesting architectural questions. HTML5 can give you access to local file storage or locally persistent databases as well as providing networked communication with remote processes. With an HTML 5 platform, the browser is more like a local application with good access to remote data.

Google has taken this idea a step further with the definition of extensions and apps for its Chrome browser. They are written in HTML, javascript and CSS: it is perfectly possible to write build a "Chrome app" that is nothing more than a web page displaying equally well in any browser. (For a web developer, the road to "Hello, world" has never been shorter.) The Chrome app is defined in a simple JSON manifest file. The manifest can define permissions for access to remote resources (no more work-arounds to deal with restrictions on unsafe cross-site scripting). It also defines how your app or extension is integrated into Chrome. A single line in the manifest can tie your app to a button permanently available on your toolbar, accessible from your choice of user action (button click, key-press combination, etc). Full Chrome apps can be distributed through Google's App Store where any Chrome user could install the app locally.

If you've ever looked at developing browser-based web applications, or have ever thought about extending Firefox with its extension mechanism, you owe it to yourself to take a quick look at
http://code.google.com/chrome/extensions/index.html. That's all it takes to get started.