From 9de8608a20efc8b27f20b6855e6425cb968cf6ce Mon Sep 17 00:00:00 2001
From: Alvin Ji
location information sources, and no guarantee is given that the API
returns the device's actual location.
+ To better protect user privacy, this specification also provides a way + for users to share an approximate location instead of a + precise one. This is often sufficient for applications that don't need + to know the user's exact location, for example, a weather application + just needs a city-level location. By sharing an approximate location, + users can still get the benefit of a location-aware application without + revealing their exact whereabouts. +
If an end user [=check permission|grants permission=], Geolocation: @@ -149,7 +158,11 @@
Request the user's current location. If the user allows it, you will - get back a position object. + get back a position object. The website can influence the position's + accuracy by using the `accuracyMode` option. By default, the user + agent will provide a `"precise"` location, but a website can request + an `"approximate"` location if it doesn't require high accuracy, + which helps protect user privacy.
+By default, the API always attempts to return a cached position so - long as it has a previously acquired position. In this example, we - accept a position whose age is no greater than 10 minutes. If the - user agent does not have a fresh enough cached position object, it - automatically acquires a new position. + long as it has a previously acquired position that matches the + requested `accuracyMode`. In this example, we accept a precise + position whose age is no greater than 10 minutes. If the user agent + does not have a fresh enough cached position object of the correct + accuracy, it automatically acquires a new position.
-Third-party usage can be selectively enabled by adding the - [^iframe/allow^]`="geolocation"` attribute to an [^iframe^] element: + [^iframe/allow^]`="geolocation"` or `allow="geolocation-approximate"` + attribute to an [^iframe^] element. Note that if `geolocation` is + allowed, `geolocation-approximate` is also implicitly allowed.
+ <!-- This allows both precise and approximate geolocation -->
<iframe
src="https://third-party.com"
allow="geolocation">
</iframe>
+
+ <!-- This allows only approximate geolocation -->
+ <iframe
+ src="https://another-third-party.com"
+ allow="geolocation-approximate">
+ </iframe>
@@ -345,7 +394,7 @@
- Permissions-Policy: geolocation=()
+ Permissions-Policy: geolocation=(), geolocation-approximate=()
@@ -364,6 +413,16 @@
+ To mitigate this privacy risk, this specification introduces the + {{PositionOptions/accuracyMode}} option, which allows users to share an + approximate location. This allows applications to function without + needing the user's precise whereabouts, thus offering a more + privacy-friendly alternative. When an application requests an + approximate location, the user agent can provide a less precise + location that still meets the application's needs while protecting the + user's exact location. +
An end-user will generally give [=express permission=] through a user - interface, which usually present a range of permission + interface. With the introduction of approximate location, this + interface SHOULD allow the user to choose between sharing a precise + or an approximate location. This choice gives users more control over + their privacy, allowing them to share a less precise location when + they are not comfortable sharing their exact whereabouts. +
++ The user interface will usually present a range of permission [=permission/lifetimes=] that the end-user can choose from. The choice of [=permission/lifetimes=] vary across user agents, but they are typically time-based (e.g., "a day"), or until browser is closed, @@ -420,6 +486,15 @@
+ In line with this principle, recipients are strongly encouraged to + request the lowest level of location accuracy that is sufficient for + their application's functionality. For instance, if an application + only needs to know the user's city, it should request an approximate + location using the `accuracyMode` option rather than a precise one. + This practice of data minimization is a key aspect of respecting user + privacy. +
The recipients of location information need to refrain from retransmitting the location information without the user’s express @@ -464,19 +539,30 @@
Geolocation is a [=default powerful feature=] identified
- by the [=powerful feature/name=] "geolocation".
+ by two permission names: "geolocation" for precise location and
+ "geolocation-approximate"
+ for approximate location.
+
+ When a website requests location access, the user agent [=check + permission|checks permission=] for the level of accuracy specified by + the {{PositionOptions/accuracyMode}} option. A grant for the + "geolocation" permission implies a grant for the + "geolocation-approximate" permission.
When checking permission - to use the API, a user agent MAY suggest time-based [=permission=] - [=permission/lifetimes=], such as "24 hours", "1 week", or choose to - remember the permission [=permission/grant=] indefinitely. However, - it is RECOMMENDED that a user agent prioritize restricting the - [=permission=] [=permission/lifetime=] to a single session: This can - be, for example, until the [=environment settings object/realm=] is - destroyed, the end-user [=navigates=] away from the [=origin=], or - the relevant browser tab is closed. + to use the API, a user agent SHOULD present the user with a choice to + grant access to their precise location, their approximate location, + or to deny the request. A user agent MAY also suggest time-based + [=permission=] [=permission/lifetimes=], such as "24 hours", "1 + week", or choose to remember the permission [=permission/grant=] + indefinitely. However, it is RECOMMENDED that a user agent prioritize + restricting the [=permission=] [=permission/lifetime=] to a single + session: This can be, for example, until the [=environment settings + object/realm=] is destroyed, the end-user [=navigates=] away from the + [=origin=], or the relevant browser tab is closed.
- [=Call back with error=] passing |errorCallback| and - {{GeolocationPositionError/PERMISSION_DENIED}}. -
-- On certain platforms, there can be a circumstance - where the user has [=permission/granted=] the user - agent permission to use Geolocation at the - browser-level, but the permission to access - location services has been denied at the OS level. -
-
+ enum AccuracyMode {
+ "precise",
+ "approximate"
+ };
+
dictionary PositionOptions {
+ AccuracyMode accuracyMode = "precise";
boolean enableHighAccuracy = false;
[Clamp] unsigned long timeout = 0xFFFFFFFF;
[Clamp] unsigned long maximumAge = 0;
};
+ + The accuracyMode member is used to request a specific + level of accuracy. It can be set to "precise" to request the most + accurate location data available, or "approximate" to receive a less + accurate location that protects user privacy. The default value is + "precise". +
++ If `accuracyMode` is set to "approximate", the `enableHighAccuracy` + member has no effect. +
++ The accuracyMode attribute indicates the accuracy level of + the position, which can be either `"precise"` or `"approximate"`. + This reflects the level of accuracy that was granted and used to + obtain the position. +
+A new `GeolocationPosition` is constructed with [=map=] - |positionData|, {{EpochTimeStamp}} |timestamp:EpochTimeStamp| and - boolean |isHighAccuracy| by performing the following steps: + |positionData|, {{EpochTimeStamp}} |timestamp:EpochTimeStamp|, + boolean |isHighAccuracy|, and string |effectiveAccuracy| by + performing the following steps:
@@ -1504,10 +1655,17 @@
- This specification defines a [=policy-controlled feature=] identified - by the token string "geolocation". Its [=policy-controlled + This specification defines two [=policy-controlled features=] + identified by the token strings "geolocation" and + "geolocation-approximate". Their [=policy-controlled feature/default allowlist=] is [=default allowlist/'self'=].
++ The "geolocation" policy controls access to precise location, while + "geolocation-approximate" controls access to approximate location. + Granting "geolocation" permission implicitly grants + "geolocation-approximate" permission as well. +
+ An approximate location is a less precise, privacy-preserving representation of the user's location. Instead of providing exact coordinates, the user agent might return a location that is intentionally coarsened to a larger area, such as the nearest city, postal code, or a predefined region. This allows users to receive locally relevant information without disclosing their precise position, giving them more control over their privacy. +
If an end user [=check permission|grants permission=], Geolocation: @@ -565,6 +568,14 @@
+ A malicious actor could potentially infer a user's precise location by collecting and correlating multiple, distinct approximate locations. To mitigate this risk of a refinement attack, when a site receives an approximate location, any subsequent calls from that same site within a user-agent-defined time window SHOULD return the exact same, cached approximate location data. A user agent might, for example, use a time window of 15 minutes. +
+- An approximate location is a less precise, privacy-preserving representation of the user's location. Instead of providing exact coordinates, the user agent might return a location that is intentionally coarsened to a larger area, such as the nearest city, postal code, or a predefined region. This allows users to receive locally relevant information without disclosing their precise position, giving them more control over their privacy. + An approximate location is a less precise, privacy-preserving + representation of the user's location. Instead of providing exact + coordinates, the user agent might return a location that is + intentionally coarsened to a larger area, such as the nearest city, + postal code, or a predefined region. This allows users to receive + locally relevant information without disclosing their precise position, + giving them more control over their privacy.
If an end user [=check permission|grants permission=], @@ -573,7 +579,13 @@
- A malicious actor could potentially infer a user's precise location by collecting and correlating multiple, distinct approximate locations. To mitigate this risk of a refinement attack, when a site receives an approximate location, any subsequent calls from that same site within a user-agent-defined time window SHOULD return the exact same, cached approximate location data. A user agent might, for example, use a time window of 15 minutes. + A malicious actor could potentially infer a user's precise location + by collecting and correlating multiple, distinct approximate + locations. To mitigate this risk of a refinement attack, when a site + receives an approximate location, any subsequent calls from that same + site within a user-agent-defined time window SHOULD return the exact + same, cached approximate location data. A user agent might, for + example, use a time window of 15 minutes.
- To better protect user privacy, this specification also provides a way - for users to share an approximate location instead of a - precise one. This is often sufficient for applications that don't need - to know the user's exact location, for example, a weather application - just needs a city-level location. By sharing an approximate location, - users can still get the benefit of a location-aware application without - revealing their exact whereabouts. + This specification provides two ways for users to share their location: + a precise position and an approximate position.
- An approximate location is a less precise, privacy-preserving - representation of the user's location. Instead of providing exact - coordinates, the user agent might return a location that is - intentionally coarsened to a larger area, such as the nearest city, - postal code, or a predefined region. This allows users to receive - locally relevant information without disclosing their precise position, - giving them more control over their privacy. + A precise position is a position returned by the underlying + [=location information source=]. By default, any location data is + considered precise, regardless of its accuracy estimate, unless it has + been explicitly coarsened by an [=approximate location information + source=] to be an [=approximate position=]. +
++ An approximate position is a less precise, + privacy-preserving representation of the user's location. Instead of + providing precise coordinates, the user agent might return a location + that is intentionally coarsened to a larger area, such as the nearest + city, postal code, or a predefined region. This is often sufficient for + applications that don't need to know the user's [=precise position=], + for example, a weather application that only needs a city-level + location. By sharing an [=approximate position=], users can still get + the benefit of a location-aware application without revealing their + [=precise position=]. +
++ An approximate location information source is a [=location + information source=] that provides an [=approximate position=]. For + example, the user agent itself can be an [=approximate location + information source=] by taking a [=precise position=] and coarsening + it.
If an end user [=check permission|grants permission=], @@ -424,13 +436,13 @@
To mitigate this privacy risk, this specification introduces the - {{PositionOptions/accuracyMode}} option, which allows users to share an - approximate location. This allows applications to function without - needing the user's precise whereabouts, thus offering a more - privacy-friendly alternative. When an application requests an - approximate location, the user agent can provide a less precise + {{PositionOptions/accuracyMode}} option, which allows the application + to request an [=approximate position=]. This allows applications to + function without needing the user's [=precise position=], thus offering + a more privacy-friendly alternative. When an application requests an + [=approximate position=], the user agent can provide a less precise location that still meets the application's needs while protecting the - user's exact location. + user's [=precise position=].
An end-user will generally give [=express permission=] through a user - interface. With the introduction of approximate location, this - interface SHOULD allow the user to choose between sharing a precise - or an approximate location. This choice gives users more control over + interface. With the introduction of [=approximate position=], [=User + agents=] with support for [=approximate position=] SHOULD allow the + user to choose between sharing a [=precise position=] or an + [=approximate position=]. This choice gives users more control over their privacy, allowing them to share a less precise location when - they are not comfortable sharing their exact whereabouts. + they are not comfortable sharing their [=precise position=].
The user interface will usually present a range of permission @@ -499,10 +512,12 @@
The recipients of location information need to refrain from @@ -548,10 +563,10 @@
Geolocation is a [=default powerful feature=] identified
- by two permission names: "geolocation" for precise location and
+ by the [=powerful feature/name=]s "geolocation" for [=precise position=] and
"geolocation-approximate"
- for approximate location.
+ for [=approximate position=].
When a website requests location access, the user agent [=check @@ -563,15 +578,16 @@
When checking permission to use the API, a user agent SHOULD present the user with a choice to - grant access to their precise location, their approximate location, - or to deny the request. A user agent MAY also suggest time-based - [=permission=] [=permission/lifetimes=], such as "24 hours", "1 - week", or choose to remember the permission [=permission/grant=] - indefinitely. However, it is RECOMMENDED that a user agent prioritize - restricting the [=permission=] [=permission/lifetime=] to a single - session: This can be, for example, until the [=environment settings - object/realm=] is destroyed, the end-user [=navigates=] away from the - [=origin=], or the relevant browser tab is closed. + grant access to their [=precise position=], their [=approximate + position=], or to deny the request. A user agent MAY also suggest + time-based [=permission=] [=permission/lifetimes=], such as "24 + hours", "1 week", or choose to remember the permission + [=permission/grant=] indefinitely. However, it is RECOMMENDED that a + user agent prioritize restricting the [=permission=] + [=permission/lifetime=] to a single session: This can be, for + example, until the [=environment settings object/realm=] is + destroyed, the end-user [=navigates=] away from the [=origin=], or + the relevant browser tab is closed.
- A malicious actor could potentially infer a user's precise location - by collecting and correlating multiple, distinct approximate - locations. To mitigate this risk of a refinement attack, when a site - receives an approximate location, any subsequent calls from that same - site within a user-agent-defined time window SHOULD return the exact - same, cached approximate location data. A user agent might, for - example, use a time window of 15 minutes. + A malicious actor could potentially infer a user's [=precise + position=] by collecting and correlating multiple, distinct + [=approximate position=]s. 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=] + data. A user agent might, for example, use a time window of 15 + minutes.
- The "geolocation" policy controls access to precise location, while - "geolocation-approximate" controls access to approximate location. + The "geolocation" policy controls access to [=precise position=], while + "geolocation-approximate" controls access to [=approximate position=]. Granting "geolocation" permission implicitly grants "geolocation-approximate" permission as well.
From 5c9f878156f4d66da663f19594bd770b7299bd9e Mon Sep 17 00:00:00 2001 From: Alvin JiAn approximate position is a less precise, privacy-preserving representation of the user's location. Instead of - providing precise coordinates, the user agent might return a location + providing precise coordinates, the user agent MUST return a location that is intentionally coarsened to a larger area, such as the nearest city, postal code, or a predefined region. This is often sufficient for applications that don't need to know the user's [=precise position=], @@ -116,10 +116,9 @@
An approximate location information source is a [=location - information source=] that provides an [=approximate position=]. For - example, the user agent itself can be an [=approximate location - information source=] by taking a [=precise position=] and coarsening - it. + information source=] that returns positions that have been + intentionally obfuscated to make it more difficult to recover the true + location.
If an end user [=check permission|grants permission=], @@ -458,12 +457,12 @@
An end-user will generally give [=express permission=] through a user - interface. With the introduction of [=approximate position=], [=User - agents=] with support for [=approximate position=] SHOULD allow the - user to choose between sharing a [=precise position=] or an - [=approximate position=]. This choice gives users more control over - their privacy, allowing them to share a less precise location when - they are not comfortable sharing their [=precise position=]. + interface. [=User agents=] with support for [=approximate position=] + SHOULD allow the user to choose between sharing a [=precise + position=] or an [=approximate position=]. This choice gives users + more control over their privacy, allowing them to share a less + precise location when they are not comfortable sharing their + [=precise position=].
The user interface will usually present a range of permission @@ -996,7 +995,7 @@
Alternatively, the API can be disabled in a first-party context by - specifying an HTTP response header: + specifying an HTTP response header. Disabling + `geolocation-approximate` will also disable `geolocation`.
- Permissions-Policy: geolocation=(), geolocation-approximate=()
+ Permissions-Policy: geolocation-approximate=()
@@ -441,7 +442,10 @@
When checking permission
From 9578188a62d0fa8f6a1d71ef0801f460956904eb Mon Sep 17 00:00:00 2001
From: Alvin Ji
The "geolocation" policy controls access to [=precise position=], while
"geolocation-approximate" controls access to [=approximate position=].
Granting "geolocation" permission implicitly grants
- "geolocation-approximate" permission as well.
+ "geolocation-approximate" permission as well, while restricting
+ "geolocation-approximate" also restricts "geolocation".
Geolocation is a [=default powerful feature=] identified @@ -572,24 +573,87 @@
- When a website requests location access, the user agent [=check - permission|checks permission=] for the level of accuracy specified by - the {{PositionOptions/accuracyMode}} option. A grant for the - "geolocation" permission implies a grant for the - "geolocation-approximate" permission, while if the - "geolocation-approximate" is denied, then so is "geolocation". + To request geolocation permission for a given + {{PermissionDescriptor}} |descriptor|, the user agent MUST run the + following steps. These steps override the default behavior of + [=request permission to use=] for these features.
+- When checking permission - to use the API, a user agent SHOULD present the user with a choice to - grant access to their [=precise position=], their [=approximate - position=], or to deny the request. A user agent MAY also suggest - time-based [=permission=] [=permission/lifetimes=], such as "24 - hours", "1 week", or choose to remember the permission - [=permission/grant=] indefinitely. However, it is RECOMMENDED that a - user agent prioritize restricting the [=permission=] - [=permission/lifetime=] to a single session: This can be, for - example, until the [=environment settings object/realm=] is + A user agent MAY also suggest time-based [=permission=] + [=permission/lifetimes=], such as "24 hours", "1 week", or choose to + remember the permission [=permission/grant=] indefinitely. However, + it is RECOMMENDED that a user agent prioritize restricting the + [=permission=] [=permission/lifetime=] to a single session: This can + be, for example, until the [=environment settings object/realm=] is destroyed, the end-user [=navigates=] away from the [=origin=], or the relevant browser tab is closed.
@@ -881,7 +945,7 @@