4

In an app the call navigator.geolocation.getCurrentPosition used to work on all major browsers. But rechecking the app lately, I saw the Firefox just doesn't work anymore (still working on Chrome; other browsers not tested)

There are other questions dealing with the same thing, Molochdaa or noxoc. Both have a fiddle for demonstration. Both do not work for me (FF only, Chrome is fine).

Since our code hasn't changed for about half a year, might it be possible that something happened to Firefox?

Code:

if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(
        onSuccessGeoLocation, onFailGeoLocation, 
        { timeout:10000 });
}
else {
    onFailGeoLocation();
}

I receive the error message: "Geolocation: Permission Denied: 1, Position unavailable: 1, Timeout: 3,". Receiving when clicking "Share" on the popup asking whether to share or not.

Community
  • 1
  • 1
Carl K.
  • 457
  • 4
  • 16
  • Can you show your codes? Did you add an error callback? If yes, what is the response of the callback? Did you try in other computer? Another guess is, you "denied" the site to fetch your geolocation. Also, worth to note that *navigator.geolocation.getCurrentPosition used to work on all major browsers* may not be accurate. IE8 and lower , as well as Opera 15, do not support this function. See: https://developer.mozilla.org/en-US/docs/Web/API/Geolocation.getCurrentPosition – Raptor Oct 29 '13 at 02:18
  • It's about the same as in the links. – Carl K. Oct 29 '13 at 02:25
  • Permission denied. Check your Firefox settings. – Raptor Oct 29 '13 at 02:36

1 Answers1

0

Which OS/Firefox-Version are you using? I had the same problem on Linux Mint 15 with Firefox 24. I just downgraded the Version to Firefox 20 and now it works. With Windows or Android I don't have any problems. Seems to be Linux/Firefox issue.

Matus F.
  • 199
  • 1
  • 2
  • 1
    Mozillas own demo does not work for me on Ubuntu/Firefox 25.0.1, http://www.mozilla.org/en-US/firefox/geolocation/#geo-demo – Robban Dec 07 '13 at 17:19