How does HTML5 Geolocation work?

Chrome and Firefox implement HTML geolocation.

My question is: how does it work? Do they have a database locally and get information from the provider, and then try to match it?

Where is the database stored? Is it possible to access?

Update1: the only drawback of geolocation is that the browser should ask the user for permission, and this is really bad for usability. I understand the security problem, but still I do not see how this will become a popular solution.

Update2: Firefox uses Google WebService to locate. Now it seems very strange, given that they are now competitors. Also this behavior is really unexpected for me ... I jumped that every browser will have its (possibly standalone) solution.

Update3: So browsers really sniff routers with your wireless network card?

Update4: After all, what information is the browser sending to the google web service? The detected SSID looks fine (and it makes sense that if they are tracked by google based on their physical position in order to search the database for relevant information), but how does it work so well in a country where Google did not crawl it? Other information that your browser sends is your ip, but is this not enough to indicate your exact location?

As for other browsers that can implement this. How should they do this? Api is not documented, only the old obsolete GEAR api gives some hint. So this is really not public.

+61
browser html5 geolocation
Nov 18 '10 at 9:40
source share
5 answers

For what it's worth, the API specification is itself agnostic for geolocation implementation. Therefore, although Mozilla Firefox and Google Chrome rely on network geolocation through the Google Location Service database, this is not a standard requirement. For example, Mobile Safari on your iPhone in some cases will use GPS rather than WiFi triangulation or geo-referencing of the cellular station, depending on which location service is the most accurate and available at the moment.

And we can hope that future browsers will provide a specific provider choice. I agree that it would be good for the privacy and functionality of users if browsers supported geolocation technologies that did not require sending a list of WiFi identifiers to third parties; I suspect that since GPS sensors are more often integrated into smartphones and laptops, we will see browsers that allow you to use GPS sensing for the W3C Geolocation APIs. It would also be nice to have a feature for desktop computers, where the location can be specified manually in the browser settings, this will also be compatible with the current specification.

+16
Nov 18 '10 at 23:38
source share

First, an amazing demonstration

Try this in Chrome.

How it works

Here is your answer. Click "How Google Chrome determines your location."

From this page:

If you allow Google Chrome to share your location with the site, the browser sends local network information to Google’s geolocation services to get an estimate of your location. Then the browser can exchange data with the requesting site. The local network information used by Google geolocation services to estimate your location includes information about visible WiFi access points, including their signal strength; Information about your local router your computer IP address. Google’s location accuracy and coverage are location dependent.

Google Chrome stores your location information so that it can be easily retrieved. This information is periodically updated; The frequency of updates depends on changes in your local network information.

In addition, I believe that Google geolocation services contain a database compiled from data collected using Google Street View, as they correspond to locations with WiFi signals from routers (or at least used to ).

Access to the database

Regarding the database (Google geolocation services), this , the SO question will help you access it.

+42
Nov 18 '10 at 10:12
source share

In Firefox, open a new tab and enter the address about:config . Pass the warning message and enter geo.wifi.uri in the filter field, now you look at the web service that Firefox uses to determine your location.

+9
Nov 18 '10 at 10:13
source share

From Firefox "How It Works" :

When you visit a location-based site, Firefox will ask you if you want to share your location.
If you agree, Firefox collects information about the nearest wireless access points and the IP addresses of your computers. Firefox then sends this information to the default geolocation provider, Google Location Services, to get an estimate of your location. This location estimate is then shared with the requesting website.
If you say you disagree, Firefox will do nothing.

and "How to determine your location in Chrome" :

If you allow Google Chrome to share your location with the site, the browser sends local network information to Google’s geolocation services to get an estimate of your location. Then the browser can exchange data with the requesting site. You should review the privacy policy of a website before sharing your location with them.

+7
Jan 07 '13 at 10:18
source share

My guess about the last question in update4 is that they supposedly update your location from time to time based on which device you are using. For example, if you used only your computer to access the Internet, and there are no known Wi-Fi networks nearby, your location will be determined by the IP address, however information about your network will be collected, later you will say that you are connecting an iPhone or any other a GPS device to your Wi-Fi network and use the GPS on it, Google will match these GPS coordinates with your SSID or Wi-Fi IP address. So, after that, when your browser on the PC sends a geolocation request, it checks if the IP and SSID (and maybe other things, for example, the SSID in the neighborhood, etc.) match, and if they match, it will return the location that was previously determined by your GPS equipped device. Of course, this is just an assumption, but it may be so .. even if you have never connected any GPS-equipped device to your network, but it still determines it exactly, it may be due to Wi-Fi networks via next door that google already knows .. what an amazing job they do, for sure :)

Update:
Firefox
Google chrome

+2
Mar 08 '12 at 9:00
source share



All Articles