HTML 5 GeoLocation in Google Chrome

I use the HTML 5 Geolocations API to track the location, however I get the following error in the Geolocation icon in the Chrome browser

"This page is blocked from tracking your location."

I went to the settings and settings page, but did not find any help.

+4
source share
3 answers

In my case, the problem was that I opened the HTML file from the file system ( file:///... ). Browsers usually try to prevent access to personal information (including location) from local files, so you should serve the file through a web server (even if it is local).

One easy way to serve a static website located on your file system is SimpleHTTPServer if you have Python installed. Just browse to the folder using the command line and say python -m SimpleHTTPServer and then you can view the file on localhost:8000 .

+1
source

Even I ran into the same problem. One solution is to open the file in another browser, I tried it in Firefox, and it worked fine. Another solution is to open the file through your WAMP server (localhost).

0
source

There is a good article on the geolocation API here. You need to go to chrome: // settings / content and there, you can find location information. You should be able to find and manage exceptions there.

-1
source

All Articles