Tuesday, August 31, 2010

HTML, CSS, and JavaScript from the Ground Up

One of the efforts I've had the most fun working on at Google was a class that Greg Veen, Ryan Carver, Sean McBride, and  Dustin Diaz put together for Googlers to learn more about HTML, CSS, and JavaScript from the UX perspective. That class has, at long last, had its contents made public (at least the screencasts anyhow). I'll be having a Manhattan tonight in celebration of all our hard work paying off =)

Check it out here: http://code.google.com/edu/submissions/html-css-javascript/

Sunday, August 8, 2010

Detecting IE Platform Preview (and User Agent detection) on Browserscope

On Browserscope we've recently encountered the conundrum of wanting to detect the IE Platform Preview branches and the fact that that information is not in the UA string. Right now, just using the new and improved IE 9 UA string offers no way to detect that someone is using a Platform Preview and also no way to tell which of the 4 previews they are using. Fortunately one can detect this stuff using Javascript, but this forced a rewrite of how we handle UA parsing in Browserscope such that we now can send in overrides for each of the fields we care about for a browser at present - the family, v1, v2, and v3 bits. The code is checked in here in case you have a better way of doing it to share. Thankfully, the IE team is doing such a great job documenting the improvements from release to release that it isn't too painful to get this detection right..

You can also check out this code in action on our UA parser test page too and if for some reason your browser isn't being correctly detected, let us know and we should be able to figure out how to get that right.

All of this though brings me back to the fact that there's really not a great, bleeding-edge accurate, user agent parsing library available today that I'm aware of. The best ones out there at present that I know of are browscap.ini and useragentstring.com, but neither of these offer the detection library itself nor are they community maintained and bleeding-edge up to date. There's also WURFL, though it's more about offering a database of capabilities than a universal browser detection tool. Is there something else out there that you know of that's good?

I still have this fantasy of a client library, written to use and cache an ordered list of regexes and patterns for detecting browsers - it would be so cool if this list could be distributed by pubsubhubbub and then any one could host their own, augment the format, or just contribute their changes back to an open source project. Do you know of anyone looking for a fun, meaningful 20% project?