Geolocation in Firefox doesn't always work

1

0

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.

Elias Zamaria

Posted 2010-07-30T23:32:45.067

Reputation: 532

I filed a bug report for this bug. You can see it at https://bugzilla.mozilla.org/show_bug.cgi?id=596481

– Elias Zamaria – 2010-09-15T04:36:28.153

Answers

1

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

Wolph

Posted 2010-07-30T23:32:45.067

Reputation: 595

Firefox is getting its geolocation info from Google. Look at this link (http://my.opera.com/CrazyTerabyte/blog/2009/07/23/how-google-firefox-geolocation-api-works). 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 – 2010-07-31T08:03:41.070

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 – 2010-07-31T16:05:31.153

0

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 ?

harrymc

Posted 2010-07-30T23:32:45.067

Reputation: 306 093

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 – 2010-08-27T18:31:29.627

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 – 2010-08-27T19:06:02.570

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 – 2010-09-09T04:29:03.843

You can already test the beta version of FF4. The developers may be more open to bug reports during the beta tests. – harrymc – 2010-09-09T05:58:49.650