If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

navigator.geolocation.getCurrentPosition() never returns regardless of permission granted

RESOLVED WORKSFORME

Status

()

Core
Geolocation
RESOLVED WORKSFORME
5 years ago
2 years ago

People

(Reporter: mastercactapus, Unassigned)

Tracking

17 Branch
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(blocking-basecamp:-)

Details

(Reporter)

Description

5 years ago
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:17.0) Gecko/20100101 Firefox/17.0
Build ID: 20121129151842

Steps to reproduce:

Requested geolocation via navigator.geolocation.getCurrentPosition( ... ) 
Clicked "Share Location" on the popup



Actual results:

No response, or timeout (if one was specified).



Expected results:

If permission is granted, the callback should be fired with position information.
(Reporter)

Updated

5 years ago
OS: Linux → Windows 7
Component: Untriaged → Geolocation
Product: Firefox → Core

Comment 1

5 years ago
Is there a public testcase you have that demonstrates this behaviour? I can't reproduce it.

Updated

5 years ago
Flags: needinfo?(mastercactapus)
Keywords: testcase-wanted
(Reporter)

Comment 2

5 years ago
It seems to show up in certain cases of using proxy or VPN connections.
I haven't narrowed it down other than on my work VPN it always fails, only on windows machines however, any other OS works fine through VPN (also physically being on the network causes it not to work)

We do have a transparent proxy running.

I couldn't reproduce the behavior in any other browser either (e.g. chrome pulled data on windows)
I'll try to get more specific cases this weekend.
Flags: needinfo?(mastercactapus)
blocking-basecamp: --- → ?

Comment 3

5 years ago
minusing.  There is *no* new information here that would suggest that we should block.
blocking-basecamp: ? → -

Comment 4

4 years ago
Hi
Similar issue but also on Linux/Mac OSX with Nightly 27.0a1 (2013-09-23), Aurora, ESR

Here is a simple way to reproduce it: https://scips.makes.org/thimble/geoloc-test-bug-firefox

I tried it on the following version of Firefox:

Failures:

27.0a1 (2013-09-23) Linux 64bit
25.0a2 (2013-09-15) Linux 64bit
ESR 24.0 Windows 7 x64
26.0a2 (2013-10-09) Mac OSX 10.8.4 (but triggers the activate privacy params from OSX) that once activated still fail with an error message: "Error while getting current position: (2) Unknown error acquiring position

Success:

23.0.1 Mac OSX

Comment 5

4 years ago
Hi, 

Same bug on Linux 32 bits (Ubuntu 12.04) and Windows 8.1 (64 bits), both with Firefox 27.0.1 (up to date).

On the test page of comment #4, I see the log "button pressedgeolocation getCurrentPosition requested" but no popup asking the permission was displayed.

Comment 6

4 years ago
Ubuntu is a known problem with their packaging, see bug 919153.

Comment 7

4 years ago
Hi, 

Same bug in Windows version too, not only Ubuntu version. I have tried on Android and Firefox OS too : ok on Android, nok in FxOS.

Visit http://www.pediaphon.org/~bischoff/location_based_services/, you will see th sea instead of your place. Others navs (Chromium, Opera,...) show the real position, not Firefox.

I wonder if geoloc is a important service ?

Comment 8

4 years ago
Hi guys, 

I don't see any fix in the changelog but this problem is resolved for me, in Firefox 28 :)

I have geoloc in the 2 websites I test (see above).

Thanks for that !

Comment 9

3 years ago
I experienced the same problem with Firefox 35.0.1 (64 bit) on Linux.

Used this page (mentioned above) to test:
https://scips.makes.org/thimble/geoloc-test-bug-firefox

The result:
button pressedgeolocation getCurrentPosition requestedError while getting current position: (2) Unknown error acquiring position

My User Agent string:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0

Comment 10

3 years ago
I'm receiving the same error using the test from above:
button pressedgeolocation getCurrentPosition requestedError while getting current position: (2) Unknown error acquiring position
On Chromium: 
button pressedgeolocation getCurrentPosition requestedGreat your location has been found: (37.9841379;23.719320399999997)

Im running Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Firefox/31.0 Iceweasel/31.4.0

Comment 11

3 years ago
I met the very same issue with Firefox 37.0.2 on Mac OS X Yoseite v10.10.2. It turns out that firefox is really slow at getting user location. It takes more than 10 seconds for getCurrentPosition to return. While Chrome returns much much faster. Setting timeout to 30 seconds can get the position, but it is visibly and remarkably slow.

Is this behavior a defect that need to be fixed?

Comment 12

2 years ago
(In reply to zhangpengdpnn from comment #11)
> I met the very same issue with Firefox 37.0.2 on Mac OS X Yoseite v10.10.2.
> It turns out that firefox is really slow at getting user location. It takes
> more than 10 seconds for getCurrentPosition to return. While Chrome returns
> much much faster. Setting timeout to 30 seconds can get the position, but it
> is visibly and remarkably slow.
> 
> Is this behavior a defect that need to be fixed?

How did you change your timeout? I get the error in a few seconds regardless of my timeout parameter. Here's my test code:

<script>
var options = {
  enableHighAccuracy: true,
  timeout: 5000,
  maximumAge: 0
};

function success(pos) {
  var crd = pos.coords;

  console.log('Your current position is:');
  console.log('Latitude : ' + crd.latitude);
  console.log('Longitude: ' + crd.longitude);
  console.log('More or less ' + crd.accuracy + ' meters.');
};

function error(err) {
  console.warn('ERROR(' + err.code + '): ' + err.message);
};

navigator.geolocation.getCurrentPosition(success, error, options);
</script>

Comment 13

2 years ago
> Im running Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101
> Firefox/31.0 Iceweasel/31.4.0

Bug in iceweasel, see: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=726230

Comment 14

2 years ago
> var options = {
>   enableHighAccuracy: true,
>   timeout: 5000,
>   maximumAge: 0
> };

maximumAge of zero forces a non-cached request, so that means a network geolocation lookup is made, and the specified network timeout is 5 seconds. Network geolocation has no guarantee of response time, and in the typical case (healthy network connection) is ~3 seconds. I would expect this request to fail regularly.

Comment 15

2 years ago
Marking as works for me, I tried to comment on the issues mentioned in this bug. Happy to re-open if there are more issues.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → WORKSFORME

Comment 16

2 years ago
Firefox 39 - OS X Yosemite version 10.10.4

Tested: https://scips.makes.org/thimble/geoloc-test-bug-firefox

Results: button pressedgeolocation getCurrentPosition requested

Clicking Not Now or closing box that asks to share your location does not trigger an error from navigator.geolocation.getCurrentPosition(). Time out never happens.

Tested: https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/Using_geolocation (scroll down to live results)

Results: Locating…

Clicking Not Now or closing box that asks for your location does not trigger an error.

Comment 17

2 years ago
(In reply to annadrazich from comment #16)
> Clicking Not Now or closing box that asks for your location does not trigger
> an error.

You are seeing bug 675533, which is a specific issue with the error callback not getting invoked.
Keywords: testcase-wanted
You need to log in before you can comment on or make changes to this bug.