Http sites does not detect the location in Chrome - issue

后端 未结 4 1601
萌比男神i
萌比男神i 2020-12-17 20:50

We did notice today an issue in automatic detection of zip code based on the user s location. it worked well in other browsers(edge, IE, Firefox) We had to configure the si

4条回答
  •  隐瞒了意图╮
    2020-12-17 21:11

    You cannot use the HTML5 Geolocation API with non-secure connections as per below:

    Starting with Chrome 50, Chrome no longer supports obtaining the user’s location using the HTML5 Geolocation API from pages delivered by non-secure connections. This means that the page that’s making the Geolocation API call must be served from a secure context such as HTTPS.

    However, it is possible to use the Google Maps Geolocation API or GeoIP, and possibly others, though it is not recommended in the long term. See below:

    There are a number of fallback options available to get a user’s location that are not affected by this change, such as Google Maps Geolocation API, GeoIP (as an example, there are other geo based solutions), and a user-entered zip code. However, we strongly recommend that the best path to ensure ongoing access to geolocation is to move to HTTPS.

    Source: Geolocation API removed from unsecured origins in Chrome 50

提交回复
热议问题