Primary eng (and PM) emails
Summary
Chrome does not enforce the maximumAge option in geolocation API calls (getCurrentPosition, watchPosition) when the location provider returns a stale position estimate. Changing the implementation to match the spec will cause a noticeable difference in behavior for applications that request fresh position estimates.
Motivation
The maximumAge option allows the caller to specify an upper bound for the age of cached position estimates. The age is calculated as the duration from the time of the position fix to the time of the API call (getCurrentPosition or watchPosition). The default value for maximumAge is zero, indicating that cached estimates should not be returned. Instead, the position callback should be delayed until a fresh estimate is available or the call times out.
Returning stale position estimates to callers who have requested fresh estimates may have privacy implications as it could expose the user's prior position estimate. For instance, a user might switch location mode from "High accuracy" to "Device only" to avoid Wi-Fi-based tracking. A cached position estimate from before the location mode was changed could expose a Wi-Fi-based estimate to the page. The risk is higher if the device is not able to generate a position fix in "Device only" mode since the cached estimate will be retained longer.
Interoperability and Compatibility Risk
The geolocation API is supported in all major browsers, but implementations differ in how they handle the maximumAge option. Due to the current diversity in behavior it is unlikely that this change poses a significant compatibility risk.
Edge: Partially supported.
Specifying non-zero values for maximumAge will not cause cached position estimates to be returned. From the observed behavior it seems that Edge does not cache position estimates.
Firefox: Supported.
Returned position estimates are never older than maximumAge. When the cached estimate is too stale, Firefox waits until a fresh estimate is available. The behavior in Firefox matches my reading of the spec.
Safari: Partially supported.
On the first call to getCurrentPosition or after a period of inactivity, Safari may return a cached estimate outside the maximumAge window. Subsequent calls return fresh estimates.
Alternative implementation suggestion for web developers
The previous behavior caused Chrome to sometimes return quickly with a cached position estimate even when the position options specified that the cached estimate should not be returned. This behavior is incorrect with respect to the spec, but ensured that callers would not experience extended delays waiting for a position estimate.
After this change, developers who need the old behavior (quickly return a cached estimate) can replicate it by setting maximumAge to a large value.
Usage information from UseCounter
Geolocation is not yet instrumented. I've created a CL to add UseCounter metrics for getCurrentPosition and watchPosition:
https://chromium-review.googlesource.com/c/chromium/src/+/747862
Tracking bug
Entry on the feature dashboard
This falls under the Geolocation feature:
https://www.chromestatus.com/features/6348855016685568
A separate feature entry is not needed as this is a minor change that brings us closer in line with the spec.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CA%2BqnoufPVy%3DT7A-M-Yt5ROrYRj_N1zu8CqjZ2uJ6RgBasBo9WQ%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CA%2BqnoufPVy%3DT7A-M-Yt5ROrYRj_N1zu8CqjZ2uJ6RgBasBo9WQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJUhtG89kCvqWz2CUdkLJ08dJ6bzReMaXqZ-G1-X7qQn6r4LhQ%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CA%2BqnoufPVy%3DT7A-M-Yt5ROrYRj_N1zu8CqjZ2uJ6RgBasBo9WQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJUhtG89kCvqWz2CUdkLJ08dJ6bzReMaXqZ-G1-X7qQn6r4LhQ%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CA%2BqnoufPVy%3DT7A-M-Yt5ROrYRj_N1zu8CqjZ2uJ6RgBasBo9WQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJUhtG89kCvqWz2CUdkLJ08dJ6bzReMaXqZ-G1-X7qQn6r4LhQ%40mail.gmail.com.
--/* Opera Software, Linköping, Sweden: CET (UTC+1) */
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CA%2BqnoufPVy%3DT7A-M-Yt5ROrYRj_N1zu8CqjZ2uJ6RgBasBo9WQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJUhtG89kCvqWz2CUdkLJ08dJ6bzReMaXqZ-G1-X7qQn6r4LhQ%40mail.gmail.com.
--/* Opera Software, Linköping, Sweden: CET (UTC+1) */
--/* Opera Software, Linköping, Sweden: CET (UTC+1) */
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/op.y9alg7myrbppqq%40cicero2.linkoping.osa.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAK-EfXnsPJf9cLKz%3DHKiEq-kjmAQcuudE-i5S%2BWX_5iy5%3DHjFA%40mail.gmail.com.