diff --git a/index.bs b/index.bs index 35ff6a7..617fe50 100644 --- a/index.bs +++ b/index.bs @@ -25,6 +25,8 @@ spec:fetch; type:dfn; for:/; text:request spec:webidl; type:dfn; text:resolve spec:infra; type:dfn; text:user agent spec:infra; type:dfn; for:/; text:list +spec:html; type:dfn; text:allowed to use +spec:webdriver2; type:dfn; text:success
 urlPrefix: https://tools.ietf.org/html/rfc9651; spec: rfc9651
@@ -50,6 +52,15 @@ urlPrefix: https://w3c.github.io/fingerprinting-guidance/
         text: passive fingerprinting; url: #dfn-passive-fingerprinting
         text: active fingerprinting; url: #dfn-active-fingerprinting
         text: Best Practice 1; url: #avoid-passive-increases
+urlPrefix: https://w3c.github.io/webdriver-bidi/; spec: webdriver-bidi
+    type: dfn
+        text: get related navigables; url: #get-related-navigables
+        text: user context; url: #user-context
+        text: get valid top-level traversables by ids; url: #get-valid-top-level-traversables-by-ids
+        text: get valid user contexts; url: #get-valid-user-contexts
+        text: error; url: #error
+    type: type
+        text: error; url: #error
 
 
@@ -440,7 +451,7 @@ has defined a number of properties for itself:
       etc.)
 *   full version - The build version (e.g.,
       "72.0.3245.12", "3.14159", or "297.70E04154A") that corresponds to the [=user agent=], or any
-      of the brands in its [=brands=] list.
+      of the brands in its [=user agent/brands=] list.
 *   model - The [=user agent=]'s device model (e.g., "", or
       "Pixel 2 XL")
 *   mobileness - A boolean indicating if the [=user agent=]'s
@@ -455,10 +466,14 @@ has defined a number of properties for itself:
       architecture bitness (e.g., "32" or "64")
 *   significant version - The marketing version which includes
       distinguishable web-exposed features (e.g., "72", "3", or "12.1"), corresponding to the
-      [=user agent=], or any of the brands in its [=brands=] list (e.g., rendering engine or
+      [=user agent=], or any of the brands in its [=user agent/brands=] list (e.g., rendering engine or
       any other [=equivalence classes=] full version).
 *   wow64-ness - A boolean indicating if the [=user agent=]'s binary is running in 32-bit mode on 64-bit Windows. (e.g., ?0 or ?1)
 
+Whenever the Client Hints are requested for the given [=environment settings object=],
+|environment settings|, if [=emulated UA Client Hints=] associated with the |environment settings|
+is not null, return the corresponding value from the [=emulated UA Client Hints=] instead of the
+default value for the requested property.
 
 [=User agents=] SHOULD keep these strings short and to the point, but servers MUST accept arbitrary
 values for each, as they are all values constructed at the [=user agent=]'s whim.
@@ -477,14 +492,20 @@ or [=platform bitness=] unless the user's platform is one where both the followi
  * Different CPU architectures are likely to require different binary executable resources, and
      different binary executable resources are likely to be available.
 
-[=User Agents=] MUST return the empty string for [=model=] if [=mobileness=] is false. [=User
-Agents=] MUST return the empty string for [=model=] even if [=mobileness=] is true, except on
-platforms where the model is typically exposed.
+[=User agents=] MUST return the empty string for [=user agent/model=] if [=user agent/mobileness=]
+is false. [=User agents=] MUST return the empty string for [=user agent/model=] even if
+[=user agent/mobileness=] is true, except on platforms where the model is typically exposed.
 
 [=User agents=] MAY return the empty string for hints of type `sf-string`,
 `false` for hints of type `sf-boolean`, or any other fictitious value, for
 privacy, compatibility, or other reasons, given a request for any the following hints:
-[=full version=], [=platform architecture=], [=platform bitness=], [=wow64-ness=] or [=model=].
+[=user agent/full version=], [=user agent/platform architecture=], [=user agent/platform bitness=],
+[=user agent/wow64-ness=] or [=user agent/model=].
+
+If the [=user agent=]'s [=emulated client hints=] is not null, the [=user agent=] MUST
+return the corresponding value from the [=emulated client hints=] instead of the default
+value for the requested property.
+f
 
 The 'Sec-CH-UA' Header Field {#sec-ch-ua}
 ----------------------------
@@ -517,8 +538,8 @@ and the significant version number (both of which are fairly clearly sniffable b
 structure of other headers and by testing for the availability and semantics of the features
 introduced or modified between releases of a particular browser" [[Janc2014]]).
 
-Note: `Sec-CH-UA` reveals the major version for each brand in the [=brands=]
-list. For use cases requiring the [=user agent/full version=], see
+Note: `Sec-CH-UA` reveals the major version for each brand in the
+[=user agent/brands=] list. For use cases requiring the [=user agent/full version=], see
 `Sec-CH-UA-Full-Version-List`.
 
 The 'Sec-CH-UA-Arch' Header Field {#sec-ch-ua-arch}
@@ -619,8 +640,8 @@ The 'Sec-CH-UA-Full-Version-List' Header Field {#sec-ch-ua-full-version-list}
 --------------------------------
 
 The `Sec-CH-UA-Full-Version-List` request header field gives a server
-information about the [=user agent/full version=] for each brand in its [=brands=] list. It is a
-[=Structured Header=] whose value MUST be a [=structured header/list=] [[!rfc9651]].
+information about the [=user agent/full version=] for each brand in its [=user agent/brands=] list.
+It is a [=Structured Header=] whose value MUST be a [=structured header/list=] [[!rfc9651]].
 
 The header's ABNF is:
 
@@ -845,7 +866,7 @@ Every {{WindowOrWorkerGlobalScope}} object has an associated
 brands frozen array, which is a
 FrozenArray<NavigatorUABrandVersion>. It is
 initially the result of [=create a frozen array|creating a frozen array=] from the [=user agent=]'s
-[=brands=].
+[=user agent/brands=].
 
 Additionally, every {{WindowOrWorkerGlobalScope}} object has an associated
 full version list frozen array, which is a
@@ -1022,6 +1043,173 @@ The toJSON() method MUST run th
 
 1. Return |uaLowEntropyData|
 
+Automation {#automation}
+========================
+
+Definitions {#automation-definitions}
+----------------------
+
+
+UserAgentClientHintsCommand = (
+  emulation.SetClientHintsOverrideCommand
+)
+
+ +A brand version is a [=struct=] with: +* [=struct/item=] named brand, which is a string; +* [=struct/item=] named version, which is a string. + +An user agent client hints is a [=struct=] with: +* [=struct/item=] named brands, which is a list of + [=brand version=] pairs or null; +* [=struct/item=] named full version, which is a string or + null; +* [=struct/item=] named full version list, which is a list + of [=brand version=] or null; +* [=struct/item=] named mobile, which is a boolean or null; +* [=struct/item=] named model, which is a string or null; +* [=struct/item=] named platform, which is a string or + null; +* [=struct/item=] named platform version, which is a string + or null; +* [=struct/item=] named architecture, which is a string or + null; +* [=struct/item=] named bitness, which is a string or null; +* [=struct/item=] named wow64, which is a boolean or null. + +A [=User agent=] has emulated client hints, which is a [=struct=] with: +* [=struct/item=] named default emulated client hints, which + is an [=user agent client hints=] or null, initially null; +* [=struct/item=] named emulated client hints per user contexts, + which is a weak map between [=user context=] and [=user agent client hints=], initially empty; +* [=struct/item=] named emulated client hints per navigables, + which is a weak map between [=/navigables=] and [=user agent client hints=], initially empty. + +## The emulation.setClientHintsOverride command {#emulation-setclienthintsoverride} + +The emulation.setClientHintsOverride command sets or removes +emulated user agent client hints for a list of [=/navigables=] or [=user context=], or globally. + +
+
Command Type
+
+
+        emulation.SetClientHintsOverrideCommand = {
+            method: "emulation.setClientHintsOverride",
+            params: {
+                clientHints: emulation.ClientHintsMetadata / null,
+                ? contexts: [+text],
+                ? userContexts: [+text],
+            }
+        }
+
+        emulation.ClientHintsMetadata = {
+            ? brands: [* emulation.BrandVersion],
+            ? fullVersionList: [* emulation.BrandVersion],
+            ? platform: text,
+            ? platformVersion: text,
+            ? architecture: text,
+            ? model: text,
+            ? mobile: bool,
+            ? bitness: text,
+            ? wow64: bool,
+            ? formFactors: [* text];
+        }
+
+        emulation.BrandVersion = {
+            brand: text,
+            version: text
+        }
+    
+
+
Return Type
+
+
+      emulation.SetClientHintsOverrideResult = {}
+      
+
+
+ +
+The emulated UA Client Hints associated with [=environment settings object=] +|environment settings|, are the result of running the following steps: + +1. Let |related navigables| be the result of [=get related navigables=] with + |environment settings|. + +1. For each |navigable| or |related navigables|: + + 1. Let |top-level navigable| be |navigable|'s [=navigable/top-level traversable=]. + + 1. Let |user context| be |top-level navigable|'s [=associated user context=]. + + 1. If [=emulated client hints=]'s [=emulated client hints per navigables=] + contains |top-level navigable|, return [=emulated client hints=]'s + [=emulated client hints per navigables=][|top-level navigable|]. + + 1. If [=emulated client hints=]'s [=emulated client hints per user contexts=] + contains |user context|, return [=emulated client hints=]'s + [=emulated client hints per user contexts=][|user context|]. + +1. Let |default emulated client hints| be [=emulated client hints=]'s + [=default emulated client hints=]. + +1. If |default emulated client hints| is not null, return + |default emulated client hints|. + +1. Return null. + +
+ +
+ +The [=remote end steps=] given |command parameters| are: + + 1. If |command parameters| [=map/contains=] "userContexts" + and |command parameters| [=map/contains=] "contexts", + return [=error=] with [=error code=] [=invalid argument=]. + + 1. Let |emulated client hints| be |command parameters|["clientHints"]. + + 1. If |command parameters| [=map/contains=] "contexts": + + 1. Let |navigables| be the result of [=trying=] to + [=get valid top-level traversables by ids=] with + |command parameters|["contexts"]. + + 1. For each |navigable| of |navigables|: + + 1. If |emulated client hints| is null, [=map/remove=] |navigable| + [=emulated client hints=]'s [=emulated client hints per navigables=]. + + 1. Otherwise, [=map/set=] [=emulated client hints=]'s + [=emulated client hints per navigables=][|navigable|] to |emulated client hints|. + + 1. Return [=success=] with data null. + + 1. If |command parameters| [=map/contains=] "userContexts": + + 1. Let |user contexts| be the result of [=trying=] to [=get valid user contexts=] + with |command parameters|["userContexts"]. + + 1. For each |user context| of |user contexts|: + + 1. If |emulated client hints| is null, [=map/remove=] |user context| from + [=emulated client hints=]'s [=emulated client hints per user contexts=]. + + 1. Otherwise, [=map/set=] [=emulated client hints=]'s + [=emulated client hints per user contexts=][|user context|] to |emulated client hints|. + + 1. Return [=success=] with data null. + + 1. [=map/Set=] [=emulated client hints=]'s [=default emulated client hints=] to + |emulated client hints|. + + 1. Return [=success=] with data null. + +
+ + Permissions-Policy Integration {#permisisons-policy-integration} ==============================