I have a MacBook Pro with OS X 10.6 and Firefox 3.6.8. I am working on a website that uses HTML5 geolocation. I noticed that it doesn't always work. It hangs for a long time, or if I have a timeout, it runs the error callback.

It seems to happen if I reload the page many times in a short period of time, like I sometimes do when I test my site. If I restart Firefox, then it works fine for a while, but eventually it stops working. It doesn't just happen on my site. I can see the same thing happen on this test page or any other site that uses this feature.

If I try the same sites in different browsers, it works fine. In Chrome, it works right away. In Safari, it may take some time, but it usually works.

Does anyone know why this is happening, or what end users or web developers can do about it? Is this common with Firefox users? I found this question on Stack Overflow hinting at it, and I asked this question on the MozillaZine forums, but I haven't gotten any answers. I thought I may have some luck here.


I'm guessing that Firefox constantly gets it's location from some webbased service that has some abuse protection. So after requesting the location very often it will limit your requests so you won't overload the servers. The end result, request your location too often and it won't work anymore.

Or it might be a similar mechanism build into Firefox, which would explain why it works after restarting Firefox.

Or... it's just a bug in Firefox, which is also a good possibility since it's quite a new feature ;)

There is a limit defined in the Firefox source, but since it's quite high I suspect it's a bug: http://mxr.mozilla.org/mozilla-central/source/dom/src/geolocation/nsGeolocation.cpp#96

  • Firefox is getting its geolocation info from Google. Look at this link (my.opera.com/CrazyTerabyte/blog/2009/07/23/…). I doubt that Google would use abuse protection that is so poorly designed that you can get around it by restarting your browser, or by using a different browser, such as Google's browser. It seems to me that the bug in in Firefox. – Elias Zamaria Jul 31 '10 at 8:03
  • I guess you're right mikez302, but it still remains to be seen wheter it's a bug or a feature. And if it's a feature, how/where it can be tweaked. – Wolph Jul 31 '10 at 16:05

There is apparently a known problem with Firefox:
geo-location-javascript freezing when behind an authentication proxy in firefox

Is this your case - are you behind an authentication proxy ?

  • Thanks for finding that issue. I get that error sometimes if I try to get the location. However, most of the time, it just makes me wait, without any indication as to what is going on. Neither the success callback nor the error callback run. I don't know if I am behind an authentication proxy. I am testing my site mostly on my home computer, which gets its internet connection from AT&T via a wireless router. – Elias Zamaria Aug 27 '10 at 18:31
  • The fact that it works in other browsers points to a Firefox bug. You could launch a query on the Mozilla forums to see if this is the same bug (prepare your query well with all required data - developers have short tempers). – harrymc Aug 27 '10 at 19:06
  • Assuming you mean the MozillaZine forums, I couldn't find any question about this issue, other than the one I asked. I may put a bug report on Bugzilla if I ever feel like figuring out how to do so. I may give it a try soon, or I may wait until Firefox 4 is released, hope it will be fixed then, and file a bug report if it is not fixed. – Elias Zamaria Sep 9 '10 at 4:29
  • You can already test the beta version of FF4. The developers may be more open to bug reports during the beta tests. – harrymc Sep 9 '10 at 5:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.