1

I have quite similar question to this one, though concerning Mobile Chrome or any other browser that I can install on Android.

I've wrote a simple script using HTML5 geolocation feature, but it does not work neither in Mobile Chrome nor Android 4.1 system browser. In first one, my script returns "User denied" error code, though I did not denied anything (and though geolocation is enabled in Chrome settings). In system browser, status remains on "Idle" (startup value), which causes me to thing, that this poor browser isn't even HTML5-compatibily and does not supports jQuery, I used.

Because I want to develop a connection-less script (location basing on device's GPS only) I need any solution that I'm able to run on Android and that allows me to use geolocation from locally stored file (accessible via file:/// protocol). Anyone got any idea?

Community
  • 1
  • 1
trejder
  • 17,148
  • 27
  • 124
  • 216

1 Answers1

1

As per the bug you linked to, geolocation and many other features are disabled for file:// URLs (just as in Chrome desktop). In regular Chrome, you can launch the browser with some useful flags like --allow-file-access-from-files, but no way to enable geolocation without running a local HTTPD.

For mobile Chrome, we are open to suggestions for new developer features. Please log this as a feature request on http://new.mcrbug.com.

Boris Smus
  • 8,220
  • 2
  • 36
  • 33
  • I have uploaded my `geo.html` to a server and accessed it via Mobile Chrome from there. Though GPS location is enabled in my phone and though I have a GPS fix (tested a second or two before in Google Maps), my HTML5-geo-enabled script is still showing some garbage location obtained from GPRS. Don't know, why it happens (I'm using Google Nexus phone). So, sure, I can report this as a feature request, but to be honest - geolocation in Mobile Chrome does not works at all, as for me, so I'll problably have to abadon this way, in favor of PhoneGapp application or even native Java app. – trejder Sep 16 '12 at 06:24
  • Since chrome 50, geolocation is only supported over https. Could it be that you tried it over http? – Bartez Sep 25 '16 at 12:34