Closed Bug 1534611 Opened 6 years ago Closed 5 years ago

Bad accuracy using Windows system API with navigator.geolocation.getCurrentPosition

Categories

(Core :: DOM: Geolocation, defect)

65 Branch
Desktop
Windows 10
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: ydobrovolskii, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36

Steps to reproduce:

From version 65 firefox returns coords with low accurency (4 digits after comma), even in v.65.0.2 (x64) Windows 10 which should cointains fix.
Tested with js: navigator.geolocation.getCurrentPosition(function(oPosition) {console.log(oPosition.coords)}); and by additional resource https://www.w3schools.com/HTML/tryit.asp?filename=tryhtml5_geolocation

Actual results:

{ latitude: **.2525, longitude: **.8425, altitude: 0, accuracy: 9149, altitudeAccuracy: 0, heading: null, speed: null }

Expected results:

Tested in v64.0.2:

{ latitude: **.2146561, longitude: **.920443, altitude: null, accuracy: 875, altitudeAccuracy: null, heading: null, speed: null }

OS: Unspecified → Windows 10
Hardware: Unspecified → Desktop

Firefox navigator.userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0"

Component: Untriaged → Geolocation
Product: Firefox → Core

Do you have Windows geolocation enabled? (at the OS system)

Blocks: 1512161
Flags: needinfo?(ydobrovolskii)

(In reply to Sylvestre Ledru [:sylvestre] from comment #2)

Do you have Windows geolocation enabled? (at the OS system)

Yes, and looks like it's a problem. After I changed this option - I had a good result.
Now with enabled this option I have bad accuracy result even in Firefox v66.
However its just for FF, for example Chrome show different result.

Flags: needinfo?(ydobrovolskii)

So in total:
If windows location is ON - accuracy is not good in FF
If it is off - it is good, as expected latitude: *.2146561, longitude: *.920443

What is the reason of so strange behavior?

By using the windows api, it uses a different geolocation database, the one from Microsoft.
If you try with edge, it should return the same coordinates.

(In reply to Sylvestre Ledru [:sylvestre] from comment #5)

By using the windows api, it uses a different geolocation database, the one from Microsoft.
If you try with edge, it should return the same coordinates.

So Chrome avoid this settings and take results from their own db, or they are compare accuracy to get the best result?!
Isn't its the bes way for FF too? Because it's a little wierd see my position on map with 9km offset...
BTW Edge now return the same result, not sure about Edge with chromium.

(In reply to ydobrovolskii from comment #6)

(In reply to Sylvestre Ledru [:sylvestre] from comment #5)

By using the windows api, it uses a different geolocation database, the one from Microsoft.
If you try with edge, it should return the same coordinates.

So Chrome avoid this settings and take results from their own db, or they are compare accuracy to get the best result?!

Chrome uses Google's own geolocation database.

Isn't its the bes way for FF too? Because it's a little wierd see my position on map with 9km offset...

The problem you found was that Firefox was trying to use Windows's geolocation database, which returned only an approximate location instead of a precise location because Windows' location privacy setting was enabled (by default).

BTW Edge now return the same result, not sure about Edge with chromium.

Edge uses Microsoft's geolocation database. I expect Microsoft's Chromium-based Edge will also use Microsoft's geolocation database (because they won't want to pay to use Google's database when they have their own).

Mozilla has an experimental geolocation database of its own. You can test it by changing two about:config settings and restarting Firefox:

geo.provider.ms-windows-location = false
geo.wifi.uri = https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%

Summary: Accuracy navigator.geolocation.getCurrentPosition → Bad accuracy using Windows system API with navigator.geolocation.getCurrentPosition

AFAIK we have no plans to address native geolocation provider issues.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.