Got an error when trying to get the geolocation in safari on iOS 10

喜欢而已 提交于 2020-01-12 04:58:17

问题


[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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!