How does Chrome know my geolocation?

前端 未结 6 1266
囚心锁ツ
囚心锁ツ 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

    Recently i worked on HTML 5 Geo-location assignment. Its supported in all modern browsers (IE9, Safari, FF, Opera).
    But when I came to Chrome its not supported. I spent several hours in fixing this.
    Finally I found a a solution:

    The geolocation in Chrome is turned off by default. To activate it, users must go to their Chrome shortcut and add --enable-geolocation to the end of the target line, under the Shortcut tab.

提交回复
热议问题