6

Possible Duplicate:
HTML 5 Geo Location Prompt in Chrome

I've been looking at geolocation in Html 5. I'm using Chrome (12) and am accessing the html file using a path like this: file:///C:/_Development/Examples/Html5/boilerplate.html

I'm getting the little geolocation icon in the search bar that says that the location has been blocked from tracking your location.

Note that I don't have any exceptions setup at all...

Can this be done or do I need to host the file on a web server? If it can't be done, why can't it be done?

Thanks

Community
  • 1
  • 1
jwwishart
  • 2,865
  • 2
  • 23
  • 26

1 Answers1

8

This is a duplicate of this question:

HTML 5 Geo Location Prompt in Chrome

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

Community
  • 1
  • 1
Swift
  • 13,118
  • 5
  • 56
  • 80
  • Thanks for the referent to the other question. The python option is interesting, didn't know you could do that. I suspect that I will be using that a lot from now on. Your answer's therefore been very valuable! Thanks again! – jwwishart Jun 13 '11 at 01:23
  • 1
    No problem. You could also use node to host the file if you wanted to be trendy haha – Swift Jun 13 '11 at 01:24
  • I am facing same issue, I cannot switch to python nor can host the page as the content is dynamic and has to be loaded form local drive only. Any other help? – Arti Jan 16 '15 at 12:22