Bug 1063739 - html5 geolocation is not working
Summary: html5 geolocation is not working
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: firefox
Version: 20
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jan Horak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 698535 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-11 11:13 UTC by Ocho
Modified: 2014-11-07 08:33 UTC (History)
16 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1161481 (view as bug list)
Environment:
Last Closed: 2014-11-07 08:33:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ocho 2014-02-11 11:13:43 UTC
Description of problem:
The html5 geolocation api seems to be "turned off" returning position unavailable error, when trying to use the feature on web pages.

Version-Release number of selected component (if applicable):
Fedora 20 - Firefox 27

How reproducible:
Wisit a geolocation web page and agree to the firefox prompt to share your location.

Steps to Reproduce:
1. Wisit any geolocation web page (example: http://www.geolocation.com/ )
2. Agree to the firefox prompt to share your location.
3.

Actual results:
error code displays

Expected results:
a location should display

Additional info:
From ask.fedoraproject.org I got this:

"Fedora Firefox RPM are build using --disable-necko-wifi , which means geolocation is disabled."

So if this is the case, could you not enable it? As the geolocation api is part of the w3c standard, and works on most other platforms.

Comment 1 IanB 2014-02-14 00:31:18 UTC
I have confirmed the same issue. Firefox 27, Fedora 20, x86_64

Comment 2 proowl 2014-05-02 15:11:52 UTC
I'm facing the same problem with Firefox 29.0 and Fedora 20 x86_64.

Comment 3 Martin Stransky 2014-05-20 15:46:45 UTC
Enabled in firefox-29.0.1-4 - see http://koji.fedoraproject.org/koji/ for new builds and please test.

Comment 4 Ocho 2014-05-20 21:11:02 UTC
(In reply to Martin Stransky from comment #3)
> Enabled in firefox-29.0.1-4 - see http://koji.fedoraproject.org/koji/ for
> new builds and please test.

I installed the finished firefox-29.0.1-4.fc19 on my fc20 but it still gives me the position unavailable error, tested in safe-mode.

Comment 5 tts 2014-05-24 07:52:55 UTC
I have the same issue with latest Firefox 29 (Aurora). As long as the firefox rpm's are build with --disable-necko-wifi, geolocation is disabled.


firefox/NetworkGeolocationProvider.js

    if (!this.wifiService && gUseScanning) {
      this.wifiService = Cc["@mozilla.org/wifi/monitor;1"].getService(Components.interfaces.nsIWifiMonitor);
      this.wifiService.startWatching(this);
    }

Returns Cc['@mozilla.org/wifi/monitor;1'] is undefined in Browser Console.

Seriously guys, this is not acceptable. 

I've lost several hours debugging this issue in my own application ... thank you

Comment 6 tts 2014-05-24 11:51:19 UTC
For all those who need a quick workaround (debugging):

1. Download the latest Firefox release from Mozilla
2. Unpack the archive
3. cd into archive and run ./firefox in command line - this will start the downloaded version

Comment 7 Martin Stransky 2014-05-26 09:30:43 UTC
(In reply to Joe Schmoe from comment #5)
> I have the same issue with latest Firefox 29 (Aurora). As long as the
> firefox rpm's are build with --disable-necko-wifi, geolocation is disabled.
> 
> 
> firefox/NetworkGeolocationProvider.js
> 
>     if (!this.wifiService && gUseScanning) {
>       this.wifiService =
> Cc["@mozilla.org/wifi/monitor;1"].getService(Components.interfaces.
> nsIWifiMonitor);
>       this.wifiService.startWatching(this);
>     }
> 
> Returns Cc['@mozilla.org/wifi/monitor;1'] is undefined in Browser Console.
> 
> Seriously guys, this is not acceptable. 
> 
> I've lost several hours debugging this issue in my own application ... thank
> you

--disable-necko-wifi is not the problem here - see comment 3 and comment 4

Comment 8 tts 2014-05-26 11:07:05 UTC
I'm facing the same problem with Firefox 29.0.1 and Fedora 20 x86_64.

Comment 9 tts 2014-05-26 11:16:14 UTC
You can find the same bug @Mozilla Bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1009688

Comment 10 Josh Matthews 2014-05-26 20:05:43 UTC
The wifiService error should be fixed upstream (just requires a null check). The missing API key should be obtained from Google: https://developers.google.com/maps/documentation/geocoding/index#api_key

Comment 11 Jan Horak 2014-05-27 06:08:41 UTC
(In reply to Josh Matthews from comment #10)
> The wifiService error should be fixed upstream (just requires a null check).
> The missing API key should be obtained from Google:
> https://developers.google.com/maps/documentation/geocoding/index#api_key

Which key is required? Mozilla is using Maps for Business I presume, 2,500 limit per 24 hours seems to be quite small, isn't it?

Comment 12 tts 2014-05-27 06:35:04 UTC
Isn't this super expensive for the Red Hat Foundation? 

I mean, millions, billions, trillions of requests per day! Shouldn't it be the right time, to improve a in-house, open-source Geocoding Service?

Maxdata GeoIP databases are much cheaper, building such a service would take minutes!

Comment 13 tts 2014-05-27 06:36:43 UTC
@Jan Horak:

Why doesn't Mozilla itself provide a Geocoding Service? Unleash from Google!

Comment 15 Ocho 2014-05-27 16:05:56 UTC
(In reply to cept0 from comment #13)
> @Jan Horak:
> 
> Why doesn't Mozilla itself provide a Geocoding Service? Unleash from Google!


https://wiki.mozilla.org/CloudServices/Location

Comment 16 Elad Alfassa 2014-06-06 10:01:09 UTC
Setting https://location.services.mozilla.com/v1/geolocate?key=something in geo.wifi.uri in about:config does make geolocation work again. Unfortunately, the data in this service is highly inaccurate if you have one or less wifi networks visible.

In the Firefox 4.x days (and even before) geolocation worked in Fedora, even when necko-wifi was disabled (see bug #698535 for details on why it was disabled). Disabling necko-wifi made it less accurate, but it still worked. When Fedora's firefox was built with necko-wifi in the 3.x days geolocation did work perfectly with Google's API. I guess Google changed their licensing terms since then?

Anyway, for now we have two viable options: 
1) purchase a "Geolocation API for Business" license from google - which is probably not going to happen
2) Change geo.wifi.uri to the mozilla location services URL by default

On the long run we would want Firefox to use GeoClue2, but until that happens we can use the Mozilla location services as a temporary workaround (I doubt it will even happen, Mozilla don't like any integration with the Linux desktop, they don't even use libnotify for desktop notifications so them using GeoClue2 seems highly unlikely to me)

Comment 17 Ocho 2014-06-06 13:49:52 UTC
Yes it works with mozilla service but is (for me) highly inaccurate, still. However it works only if my wifi is turnd on. With a usb internet dongle and wifi turned off, it does not work. Geolocation should work regardless if you have wifi or not on your computer, or if it is turned on or off, protocol for geolocation API should be GPS - Wifi access points - IP location, so if wifi fails IP location should kick in, but it doesn't. So there is more stuff going on that is not right.

Comment 18 Elad Alfassa 2014-06-06 14:15:32 UTC
(In reply to Ocho from comment #17)
> Yes it works with mozilla service but is (for me) highly inaccurate, still.
> However it works only if my wifi is turnd on. With a usb internet dongle and
> wifi turned off, it does not work. Geolocation should work regardless if you
> have wifi or not on your computer, or if it is turned on or off, protocol
> for geolocation API should be GPS - Wifi access points - IP location, so if
> wifi fails IP location should kick in, but it doesn't. So there is more
> stuff going on that is not right.

This will be solved once (if ever) Mozilla will switch to GeoClue2

Using mozilla location services directly is a workaround that will improve the situation at least for some users in the meanwhile.

GeoClue2 also uses the Mozilla geolocation services, but also has IP and GPS based geolocation support. In theory if you have a cellular modem GeoClue2 could use cellular tower IDs too (I don't know if this is implemented).

If you want to improve the accuracy and completeness of the Mozilla geolocation services, look at https://location.services.mozilla.com/ and install the Android app to map wifi networks and cell towers in your area.

Comment 19 Josh Matthews 2014-06-06 16:23:15 UTC
https://bugzilla.mozilla.org/show_bug.cgi?id=485472 is tracking a geoclue geolocation provider, and has a patch attached.

Comment 20 Martin Stransky 2014-06-16 11:51:36 UTC
*** Bug 698535 has been marked as a duplicate of this bug. ***

Comment 21 Robin 2014-06-22 20:39:19 UTC
Looks like this has been solved by Ubuntu: https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/1231273

"Looking here:

  https://bugzilla.mozilla.org/show_bug.cgi?id=919153

It seems that each distro needs a new key from Google for location tracking, er, discovery."

"The key can be added to the build with the configure flag --with-google-api-keyfile=file."

"I believe that https://developers.google.com/maps/documentation/business/geolocation/ is the relevant information page for obtaining a key."

Comment 22 Jason Merrill 2014-11-06 15:26:11 UTC
Geolocation is working for me now in firefox-33.0-1.fc20.x86_64

Comment 23 Martin Stransky 2014-11-07 08:33:52 UTC
Yes, it has been fixed already.


Note You need to log in before you can comment on or make changes to this bug.