Navigator.geolocation.getCurrentPosition does not work in Firefox 30.0

I am using Firefox 30.0 (latest FF), navigator.geolocation.getCurrentPosition works in Chrome, but not in this version of FF.

Here is my code

  if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(GEOprocess, GEOdeclined); }else{ alert('Your browser sucks. Upgrade it.'); } function GEOdeclined(error) { alert('Error: ' +error.message); } function GEOprocess(position) { alert('it works'); } 

I get this error

 Error: Unknown error acquiring position 

Note. It only stopped when updating my FF to 30.0

+7
firefox navigator
source share
2 answers

Now I am using 47 Mozilla. I tried everything, but this problem all the time. BUT , then I will open about: config in my address bar, go to geo.wifi.uri and change its value to " https://location.services.mozilla.com/v1/geolocate?key=test ". working!

+19
source share

I have a possible solution:

I think the mozilla guys changed something during the location process, so now it takes longer and the getCurrentPosition function gets a timeout.

This will answer the question why it works in chrome, worked in FF 29, and not in FF 30.0.

But this is a wildcard. Now back to the real world:

I typed a wait time of 10 seconds and now it works. I did it like this:

 navigator.geolocation.getCurrentPosition(onSuccess, onError, {timeout:10000}); 

This fixed it for me. He works for FF 30.

+2
source share

All Articles