Skip to content

Conversation

@alvinjiooo
Copy link

@alvinjiooo alvinjiooo commented Sep 5, 2025

This commit introduces the ability for users and developers to request a less precise, privacy-preserving "approximate" location.

Key changes include:

  • A new accuracyMode option in PositionOptions to request either "precise" or "approximate" location.
  • A new geolocation-approximate permission and policy, which is implicitly granted if the "geolocation" permission is given.
  • Separate internal caching for precise and approximate positions.
  • Updated "Request a position" and "Acquire a position" algorithms to handle the new accuracy levels, permission fallback, and caching logic.
  • The GeolocationPosition interface now includes an accuracyMode attribute to reflect the accuracy of the returned position.
  • Expanded the introduction with a non-normative description of what an "approximate location" is.
  • Added a normative privacy requirement for user agents to mitigate precise location reconstruction by caching approximate locations for a period of time.

Closes #182

Approximate Geolocation explainer


Preview | Diff

@alvinjiooo alvinjiooo requested a review from nondebug September 5, 2025 18:25
@reillyeon
Copy link
Member

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.

@marcoscaceres
Copy link
Member

@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.

@alvinjiooo alvinjiooo force-pushed the add-approximate-geolocation branch from 99d9b03 to 3fa8869 Compare September 22, 2025 22:49
@marcoscaceres marcoscaceres added the TPAC2025 Topics for discussion at TPAC 2025 label Oct 28, 2025
@marcoscaceres marcoscaceres requested a review from Copilot October 29, 2025 06:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 accuracyMode option 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.

@alvinjiooo alvinjiooo force-pushed the add-approximate-geolocation branch from 3fa8869 to 8658f5a Compare December 5, 2025 19:45
@alvinjiooo alvinjiooo marked this pull request as draft December 5, 2025 20:13
@alvinjiooo alvinjiooo self-assigned this Dec 5, 2025
@alvinjiooo alvinjiooo force-pushed the add-approximate-geolocation branch 6 times, most recently from 2354ca8 to d3a4d47 Compare December 12, 2025 18:56
@alvinjiooo alvinjiooo requested a review from nondebug December 12, 2025 18:58
@alvinjiooo alvinjiooo marked this pull request as ready for review December 12, 2025 19:00
Copy link
Member

@antosart antosart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments wrt the permission handling.

Copy link
Member

@marcoscaceres marcoscaceres left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove all the "Candidate addition" stuff. We don't need any of that additional markup anymore (but leave the rest of normative text there 😄 ) .

@alvinjiooo alvinjiooo force-pushed the add-approximate-geolocation branch from d3a4d47 to b0d0589 Compare January 10, 2026 04:54
algorithm=] given a new {{PermissionDescriptor}} with its
{{PermissionDescriptor/name}} set to "geolocation".
</li>
<li>Let |effectiveAccuracy:AccuracyMode?| be `null`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should somehow make sure that effectiveAccuracy is approximate if in the api call accuracyMode: approximate was passed. I think this step is missing, since here you are just getting the maximum accuracy permission granted by the user. Or am I missing something?

</p>
</p>Third-party usage can be selectively enabled by adding the
[^iframe/allow^]`="geolocation"` or
[^iframe/allow^]`="geolocation-approximate"` attribute to an [^iframe^]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of explainers-by-googlers/approximate-geolocation#19 and explainers-by-googlers/approximate-geolocation#20 I don't think we can make the policy-controlled feature geolocation-approximate work as expected. I suggest dropping it from this PR and we'll see whether we can fix things later on. WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

TPAC2025 Topics for discussion at TPAC 2025

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Approximate geolocation

5 participants