Initiate geolocation request *before* user clicks "Share Location" button to reduce UI latency




4 years ago
10 months ago


(Reporter: cpeterson, Unassigned)



Firefox Tracking Flags

(Not tracked)




4 years ago
GLS requests take about five seconds. Chrome seems to initiate their GLS request when they display the permission bar, so the position result can be returned immediately after the user clicks "Allow". The user's interaction with the permission bar masks the GLS latency because they happen in parallel. In contrast, Firefox waits until after the user clicks "Share Location", leaving the user waiting for five more seconds.

Compare the behavior of Google Maps in Chrome and Firefox:

0. Reset your geolocation permissions (about:permissions) from always-allow to always-ask (or just use a new profile)
1. Load Google Maps:
2. Click Google Maps' "geolocate me" button
3. When the Firefox doorhanger or Chrome permission bar appear, WAIT FIVE SECONDS
4. Click the "Share Location" or "Allow" button.

Chrome returns your position immediately. Firefox returns your position after five more seconds.

If you repeat the STR but click the "Share Location" or "Allow" button ASAP instead of waiting five seconds, then both Firefox and Chrome take about five seconds to return your position!

Comment 1

4 years ago
Note that sending a request to GLS before the user has clicked "Share Location" might be a privacy issue. The user might not expect GLS to receive a request, possibly identifiable by IP address, if they click the "Never Share Location" or "Now Now".
Keywords: privacy

Comment 2

4 years ago
Sending a request to GLS before the user has clicked "Share Location" is an privacy issue.

Comment 3

4 years ago
Starting the wifi and GPS scanners up wouldn't be a privacy issue. That is where the delay comes from.

Comment 4

4 years ago
I said it's an privacy issue, nothing should be collect before i click "Share Location" example can an addon make use of this collected wifi-data without user interaction?

Comment 5

4 years ago
WIFI and GPS scanners are internal. The possibility I refer to in comment 3 is to initiate scan on those layers.


3 years ago
Severity: normal → enhancement
Version: 30 Branch → unspecified
Other than privacy, my biggest concerns are about the overall performance of this thing.

Getting a fix is a very expensive and power-hungry operation (hence the long time to get it), so we shouldn't trigger this activity unless we are sure the user wants it. This observation stands mostly for battery powered devices, of course.

Currently, I'd advise to keep the current behaviour but I'm open to listen to reason: perhaps I haven't considered some edge case.:)

I'm closing this as it's been sitting idle for months. Feel free to reopen it if there's something compelling to add.
Last Resolved: 2 years ago
Resolution: --- → WONTFIX

Comment 8

2 years ago
btw, I retested the "wait five seconds before sharing my location" STR in comment 0 in Firefox and Chrome. In both browsers, Google Maps location lookup fails with a "Your location could not be determined." message if you wait too long with before sharing your location. So there is no benefit to optimizing this case.
You need to log in before you can comment on or make changes to this bug.