Archive for the ‘Uncategorized’ Category

Geolocation in Firefox and Beyond

Wednesday, May 7th, 2008

In preparation for her keynote on the at the Web 2.0 Expo, Mitchell and I recently chatted about the “mobile web” misnomer. The misnomer is that there is going to be, long term, such a thing as a separate mobile web. There should only the one web (to rule them all), with different views into it, depending on the particular limitations or abilities of the device you are using.

One place I see the desire to separate the two webs is in geolocation. Location is often billed as the next killer-app of the mobile world, and people generally assume that it is a feature that will be bound to mobile devices. Yet, there are compelling reasons to have location information available to laptops as well: it is nice to have contextually relevant information available to me while working at a new coffee shop, traveling, or when farblonjet. At the core of the one-Web vision is the continuity of experience across all of my devices.

One of the symptoms of the the mobile-only location information is that to make something location aware, you have to deal with the large overhead of compiling an old-style application and porting it to all desired platforms. Then you have to figure out how to import the bits of the web you want into that application. It’s a pain.

What’s the solution? Adding geolocation to the browser, irrespective of whether it is on mobile or the desktop. That way writing a location-aware app is just writing a web-app with a little bit of new javascript magic.

I’ve been thinking about an API/spec, basing it on the work already done by Doug Turner and Ryan Sarver at locationaware.org. Here’s how it’s looking.

Simple call:

var geolocator = new navigator.GeolocationRequest();
geolocator.request(function(location) {
  alert( location.latitude + ', '+ location.longitude + ", " + location.accuracy );
});

That should be pretty obvious. The only bit that needs explanation is accuracy, which is a measure of how accurately the system is determining your location. Accuracy can be an enum with the these meanings: “exact”, “neighborhood”, “city”, “state”, “country”. I’ll come back to the reasoning behind doing it this way. However, it is worth thinking about also having an attribute location.errorInMeters (If you have thoughts on this, comment away!).

Complex call:

var geolocator = new navigator.GeolocationRequest();
geolocator.request({
  success: function(location) { /* We've got the location! */ },
  error: function(err){ /* There was an error getting location. */ },
  accuracy: "neighborhood"
});

Accuracy is the desired accuracy for the request. It’s there to make it easy for users and developers to see eye-to-eye on privacy and reliability. By putting accuracy into understandable, semantic, and quantized levels, we make it fast to understand what a web-app is trying to request. This way, if the user has globally allowed web sites access to their location at the neighborhood level, then any location request at the neighborhood or less-accurate level won’t cause the security/privilege UI to be invoked. And when the the request invokes the security/privilege UI, it can let the user know, in human-terms, what level of location information is being requested.

Here’s a quick mockup of the security UI. I haven’t put to much thought into ways of making this nicer yet, although I’d love something that gave a more visually compelling message of how much information you are giving out to websites.

Geolocation Security Mockup

I should be releasing a mock library for starting to play with this API soon. After that comes the real thing.

Blogging and Hiring

Tuesday, May 6th, 2008

I’ve been very quiet since joining Mozilla. Too quiet. I’ve been catching my breath and getting up to speed. It’s time, however, to start blogging again. I’ll be blogging here, but I’ll be mirroring the posts on the Humanized blog for a while. Be warned that the new blog has a temporary look, meant to be replaced soon by the awesome work of Naz Hamid. I should also point out that Atul has already begun talking about his experiences at Mozilla on his blog. You can also follow the sundry happenings of Jono and Andrew on their respective blogs.

The open source world is the world’s largest and arguably, the world’s best engineering department. It lacks a comparable design department. One of my goals in coming to Mozilla was to work on bridging this gap between the engineering world and the design world. I’ve only begun to think about the problem, and I hope to begin some conversations about the topic soon. An exciting aspect of working for Mozilla is that almost all of your design work can happen out in the open. There are none of those we-take-your-ideas-and-lock-you-away-from-the-sun policies that many other companies shackle their employees with. I hope to start sharing those design processes as well.

Which brings me to: We are hiring! Mozilla is looking for some top-notch UI/UE/UX/IA/IxD/HCI/TLA people. There are few places in the world where the user-to-employee ratio is roughly 1.2 million to 1. Getting to help shape the future of the web is hard work, but it’s easily worth it. If you are interested, send me an email at azzcsa@mozilla.com.