Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

[blocked] Access to geolocation was blocked over insecure connection to http://www.hnsjb.cn.

Should I change my website to the https protocol?

like image 701
sxxhlx Avatar asked Sep 22 '16 07:09

sxxhlx


2 Answers

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.

like image 97
mstahv Avatar answered Oct 12 '22 11:10

mstahv


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.

like image 37
Alban Kraus Avatar answered Oct 12 '22 11:10

Alban Kraus