问题
[blocked] Access to geolocation was blocked over insecure connection to http://www.hnsjb.cn.
Should I change my website to the https protocol?
回答1:
iOS 10 and also desktop Safari 10 seem to require https connection now. Safari also seems to be more strict than what Chrome did earlier. No mixed content warnings are allowed, Chrome allows e.g. map tiles to load over normal http.
回答2:
I could not find any guideline specific to Safari, but this issue has been discussed by other web browsers as well.
In particular, the announcement about Google Chrome blocking geolocation over an insecure connection, published on developers.google.com in April 2016, under the last paragraph “I really need to use Geolocation. What should I do?”, advises:
If you would like to use the HTML5 Geolocation API, or if your site already uses the Geolocation API, please migrate the pages making Geolocation API calls to HTTPS, ensuring that they’re used in a secure context.
来源:https://stackoverflow.com/questions/39633313/got-an-error-when-trying-to-get-the-geolocation-in-safari-on-ios-10