How does HTML5 Geolocation Work?

后端 未结 5 1252
囚心锁ツ
囚心锁ツ 2020-12-04 09:32

Chrome and Firefox have HTML Geolocation implemented.

My question is: how does it work? Do they have a Database locally and get the information from the provider the

5条回答
  •  抹茶落季
    2020-12-04 10:21

    My guess to the last question in update4 is that supposedly they are updating your location from time to time, based on what device you use. For example if you used only your PC to access the web, and there is no known wifi networks nearby then your location will be determined by IP address, however information about your network will be gathered, later say you connect iPhone or any other device with GPS to your same wifi network, and use GPS on it, google will match those GPS coordinates to your wifi SSID or IP address. So, after then whenever your browser on PC sends a request for geolocation, it will check if the IP and SSID match (and maybe bunch of other things too, like SSID's in neighborhood and so on), and if they match, it will return the location that was previously determined by your GPS equipped device. This is just a guess of course, but it could be so.. also, even if you have never connected any GPS equipped device to your network, but it still determines it accurately, that might be because of the wifi networks in neighborhood, that are already known by google.. that's an awesome work they do, for sure :)

    Update:
           Firefox
           Google Chrome

提交回复
热议问题