I am developing a website which require the use of the navigator.geolocation object through a local development environment on MACOSX. I am using Chrome 53. Considering geolocation is blocked on anything that isn't HTTPS how am I suppose to develop my website locally? The Google Developers site quotes:
Does this affect local development?
It should not, localhost has been declared as "potentially secure" in the spec and in our case geolocation requests served at the top level over localhost will still work.
Here's what I am seeing:
Geolocation console warnings
Any ideas? (aside from switch browser)
http://localhost
is treated as a secure origin, so you don't need to do anything, the Geolocation will work.
If you're using another hostname that points to the localhost (Ex: http://mysite.test
) then you should run chrome from the command line with the following option: --unsafely-treat-insecure-origin-as-secure="http://mysite.test"
.
Example
google-chrome --unsafely-treat-insecure-origin-as-secure="http://yoursite.test"
More details on Deprecating Powerful Features on Insecure Origins
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With