How does Chrome know my geolocation?

前端 未结 6 1268
囚心锁ツ
囚心锁ツ 2020-12-24 13:16

Chrome seems to be very accurate in detecting my location. How does it do it? Can you point me to the source code?

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-24 13:35

    Geolocation can be calculated based on:

    1. GPS (if available)
    2. Available wi-fi networks and signal strengths
    3. Available cell towers and signal strengths
    4. IP Address lookup

    See the W3C Geolocaton API and Google Gears API (which Chrome's/W3C Geolocation API is based on).

    Chromium's geolocation source code can be viewed online.

提交回复
热议问题