Navigator.geolocation.getCurrentPosition is not allowed to access the file: /// C: /

Possible duplicate:
HTML 5 Location Reporting in Chrome

I look at geolocation in Html 5. I use Chrome (12) and access the html file using this path: file: /// C: / _Development / Examples / Html5 / templateplate. HTML

I get a small geolocation icon in the search bar that says the location is blocked from tracking your location.

Please note that I have no exception settings ...

Can this be done or do I need to host the file on a web server? If this is not possible, why is it impossible?

thanks

+6
source share
1 answer

This is a duplicate of this question:

HTML 5 Location Reporting in Chrome

It seems that chrome has security restrictions when accessing geolocation data locally. You need to place the file to use the data. A workaround with python is available in the previous question.

+8
source

Source: https://habr.com/ru/post/890369/


All Articles