The latest Firefox 3.1 (code name Shiretoko) nightlies include support for the W3C draft specification of Geolocation API, opening the way for yet richer web applications that can offer content customized to a user’s current location.
The API implementation enables the browser to act as a position broker communicating with the computer’s positioning API (probably connected to a GPS device or similar), and providing programmable objects web developers can access to retrieve this information. Due to the obvious privacy issues involved, the browser should always require explicit user consent to enable this interface, but the exact privacy and security considerations are to be defined.
A simple way to test it is with Doug Turner’s Geolocation extension (available as an experimental extension in Mozilla Add-ons), which acts as a “soft GPS” responding to requests with fixed coordinates you enter through the extension’s options dialog. As Doug explains, the extension makes sense in those cases where you don’t have a GPS but still want to benefit of a geo-customized experience, a valid option for millions of desktop users.
Once installed, you can test it on Doug Turner’s test page, which will give a cool stream of coordinates pulled from your ‘soft GPS’. But it won’t be long before you realize it’s the same pair all the time!
The geolocation specification itself is a draft and subject to change, so this feature could be even pulled back as was the case for cross site Ajax requests during Firefox 3 development for the same reason. For Mozilla there is no point in supporting a fluctuating standard which could lead to future incompatibilities.
Another point of discussion are the levels and number of levels of geolocation precision. Additional levels such as city and state were proposed but would only make sense in federated countries. A better alternative could be simpler 10 base radiuses like 10 meters, 100m, 1Km, 10Km, etc. but English system countries may not be that pleased as well.
The API was also added to Fennec, the Firefox Mobile project, and is already available in the latest released milestones for the Nokia tablet platform. Only the N810 has a GPS and will be able to use it though.
Google Gears, now included in Chrome, also features a geolocation API implementation incompatible with Firefox’s (and the current working draft) but Google is involved in the spec creation process and will hopefully adjust it to the final version when ready.