Conversation
|
For readability as you iterate on this proposal it's okay for this PR to directly change the specification text however to land this change the changes need to be enclosed in the correct candidate additions/corrections/deletions syntax. |
|
@reillyeon if it's ok, let's move this to CR first (i.e., let's not waste time with the ins/dels). We are close to publishing as CR again. |
99d9b03 to
3fa8869
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for approximate location positioning to the Geolocation API specification. It introduces a privacy-preserving alternative to precise location sharing, allowing applications to request coarse-grained location data when high accuracy is not needed.
Key changes:
- Introduces
accuracyModeoption with "precise" (default) and "approximate" values - Adds new "geolocation-approximate" permission alongside existing "geolocation" permission
- Implements separate caching for precise and approximate positions
- Updates permission request flows to allow users to choose between precise and approximate location sharing
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3fa8869 to
8658f5a
Compare
2354ca8 to
d3a4d47
Compare
antosart
left a comment
There was a problem hiding this comment.
A few comments wrt the permission handling.
d3a4d47 to
b0d0589
Compare
It sounds like #181 will be landed soon once the status change happened. I will rebased this PR again once that one is landed. |
491b324 to
79598a3
Compare
79598a3 to
75126d4
Compare
|
Hi @marcoscaceres and @antosart , |
- Define explicit coherence requirements between "geolocation" and "geolocation-approximate" permission states. - Fix typos and clarify logic in the precise permission query algorithm. - Update the 'set emulated position data' definition and 'Acquire a position' algorithm to consume an Infra map, aligning the Geolocation spec with the WebDriver BiDi implementation. - Rename effectiveAccuracy to accuracyMode in the 'Constructing a GeolocationPosition' algorithm.
antosart
left a comment
There was a problem hiding this comment.
looks good to me now, thanks for all the iterations on this!
|
Hi @marcoscaceres , |
- Update GeolocationPosition and GeolocationCoordinates interfaces to move accuracyMode. - Update 'Acquire a position' and 'Constructing a GeolocationPosition' algorithms to reflect the move. - Align emulation logic with WebDriver BiDi by using 'type' for error codes and embedding accuracyMode in coordinates. - Tidy index.html.
|
Hi @reillyeon, |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 6 comments.
Comments suppressed due to low confidence (1)
index.html:951
- This uses
[=list/remove=](lowercaselist), but elsewhere the spec uses[=List/remove=]for the Infra list operation. The lowercase form likely won’t resolve to the intended definition; please align the casing with the rest of the document.
If |resolvedPermissionState| is "denied", then:
<ol>
<li>If |watchId| was passed, [=list/remove=] |watchId| from
|watchIDs|.
</li>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
marcoscaceres
left a comment
There was a problem hiding this comment.
Looking good @alvinjiooo ... there seems to be some unrelated editorial changes.
Maybe see about splitting those out (get Genini maybe to do them quickly?). Will make this easier to review.
| [=approximate positions=]. To mitigate this risk of a refinement | ||
| attack, when a site receives an [=approximate position=], any | ||
| subsequent calls from that same site within a user-agent-defined time | ||
| window SHOULD return the exact same, cached [=approximate position=] |
There was a problem hiding this comment.
This needs to be in the algorithm (if it's not already).
There was a problem hiding this comment.
I did consider formalizing this caching logic within the algorithm. However, opinions on the practical risk of precise location reconstruction still vary, and there isn't a single standardized approach yet. Coupled with the existing visibility requirements, a caching window (like 15 minutes) already makes reconstruction extremely difficult in practice. Keeping this in the Privacy Considerations section provides strong guidance while leaving implementers flexibility as mitigation strategies evolve. I’m inclined to leave it as a 'SHOULD' recommendation rather than a hard algorithmic requirement for now, but I'd be interested to hear your thoughts on this framing.
| <dl class="switch"> | ||
| <dt id="permission-denied"> | ||
| User or system denied permission: | ||
| <li data-cite="infra">If acquiring the position data from the |
There was a problem hiding this comment.
This change seems unrelated or maybe the white space got screwed up?
There was a problem hiding this comment.
This one is not changed by the PR, the original place is at here. It got moved further down because the introduced change for approximate geolocation.
| </ol> | ||
| </li> | ||
| </ol> | ||
| <dl class="switch"> |
There was a problem hiding this comment.
Does this belong in this PR? Can it be a separate PR?
There was a problem hiding this comment.
This part is not changed too, the original place is at here.
- Rephrase privacy risk mitigation and user choice framing for clarity and neutrality. - Update terminology from 'powerful features' to 'permissions' and 'protecting' to 'obscuring'. - Add cross-references to the 'acquire a position' algorithm and AccuracyMode enum values. - Fix ReSpec linking errors and IDL formatting. - Remove redundant MUST statements from informative notes. - Tidy index.html.
|
Really nice work getting this to a reviewable state, @alvinjiooo. I want to raise a privacy concern about two pieces: The design lets sites request approximate via
Permissions Policy gating: I think Summary:
I'd like to invite @martinthomson, @saschanaz, and @npdoty to weigh in on the privacy model here. Once we converge on the right shape, I think this warrants a formal PING review given the sensitivity of location privacy. |
marcoscaceres
left a comment
There was a problem hiding this comment.
See #195 (comment) ... as I think the permission model needs a significant overhaul... and could be simultaneously significantly simplified.
| </pre> | ||
| </aside> | ||
| <p> | ||
| Similarly, you can request a cached approximate position. |
There was a problem hiding this comment.
| Similarly, you can request a cached approximate position. | |
| Similarly, you can request a cached approximate position: |
| successCallback, | ||
| console.error, | ||
| { maximumAge: 600_000 } | ||
| { maximumAge: 600_000 } // `accuracyMode` defaults to "precise" |
There was a problem hiding this comment.
| { maximumAge: 600_000 } // `accuracyMode` defaults to "precise" | |
| { | |
| maximumAge: 600_000, | |
| // `accuracyMode` defaults to "precise" | |
| } |
| new position. | ||
| </p> | ||
| <aside class="example" title="Getting cached position"> | ||
| <aside class="example" title="Getting a cached precise position"> |
There was a problem hiding this comment.
Just a nit... but it feels like we could cover both cases with just one example.
| The {{PositionOptions/accuracyMode}} option enhances user privacy by | ||
| providing websites with the choice to request an [=approximate | ||
| position=]. This allows applications to function without needing the | ||
| user's [=precise position=], thus offering a more privacy-friendly |
There was a problem hiding this comment.
| user's [=precise position=], thus offering a more privacy-friendly | |
| user's [=precise position=], thus offering a more privacy-preserving |
| the user agent can provide a less precise location that still meets the | ||
| application's needs while obscuring the user's [=precise position=]. |
There was a problem hiding this comment.
The user agent can't know if the position will meet the sites needs. It can only return an approximate position. If it's good enough, that's up to the site to determine.
| the user agent can provide a less precise location that still meets the | |
| application's needs while obscuring the user's [=precise position=]. | |
| a supporting user agent MUST provide a less precise location, | |
| obscuring the user's [=precise position=]. |
| (for approximate location). | ||
| </p> | ||
| <p> | ||
| There is a strict dependency between the [=permission state=]s of |
There was a problem hiding this comment.
| There is a strict dependency between the [=permission state=]s of | |
| There is a strict dependency between the [=permission states=] of |
| implies denying a [=precise position=]. This results in the following | ||
| allowed combinations of states: | ||
| </p> | ||
| <ul> |
There was a problem hiding this comment.
Nit: I wonder if this should be a table?
| <p> | ||
| Implementers MUST ensure that these states remain coherent. For | ||
| example, if a user changes the [=permission state=] of | ||
| <a>"geolocation-approximate"</a> to [=permission/"denied"=] via site |
There was a problem hiding this comment.
Right, but this needs to be an algorithm. We can wire up the Permission side later, but this still needs to be algorithmically defined.
Basically, the algorithm receives the new state, and then it dos all the things defined here.
| <p> | ||
| Implementers MUST ensure that these states remain coherent. For | ||
| example, if a user changes the [=permission state=] of | ||
| <a>"geolocation-approximate"</a> to [=permission/"denied"=] via site |
There was a problem hiding this comment.
Also, this can be very racy, so some kind of coordinator will still be needed where this is queued.
| while <a>"geolocation"</a> is a [=powerful feature=] with: | ||
| </p> | ||
| <ul> | ||
| <li>A custom [=powerful feature/permission result type=] |
There was a problem hiding this comment.
Do we really need to leak the user's choice? This seems like it shouldn't be needed. The site should just get back a portion, but it shouldn't know what the user selected or when it's changed, right?
|
Wrt leaking the granted accuracy (either in As for the |
|
I get that Android's current The spec should push implementations toward privacy (guidance on resisting detectability), not codify worst-case current behavior as the API surface. On the "sites need to know" argument: I think there are two legitimate needs here, and neither requires
So the model would be: CSS media feature for capability → On Permissions Policy: agreed it's non-trivial. I've looked at issues explainers-by-googlers/approximate-geolocation#19 and explainers-by-googlers/approximate-geolocation#20 in the explainer repo. The inheritance problem needs upstream Permissions Policy spec work, but that seems like the right path rather than working around it. |
Closes #182
This commit introduces the ability for users and developers to request a less precise, privacy-preserving "approximate" location.
Key changes include:
The following tasks have been completed:
Implementation commitment (and no objections):
Documentation (new feature):
For documentation, either create an issue or pull request in MDN's Content repo - providing as much information as you can. PR is prefered.
Approximate Geolocation explainer
Preview | Diff