diff --git a/index.bs b/index.bs index 89ae6e21..af8f83f9 100644 --- a/index.bs +++ b/index.bs @@ -200,8 +200,9 @@ spec: HTML; urlPrefix: https://html.spec.whatwg.org/multipage/ text: shared worker; url: workers.html#shared-workers text: system visibility state; url: document-sequences.html#system-visibility-state text: traversable navigable; url:document-sequences.html#traversable-navigable - text: visible; url: document-sequences.html#system-visibility-state text: traverse the history by a delta; url: browsing-the-web.html#traverse-the-history-by-a-delta + text: user agent; url: system-state.html#dom-navigator-useragent + text: visible; url: document-sequences.html#system-visibility-state text: window open steps; url: window-object.html#window-open-steps text: worker event loop; url: webappapis.html#worker-event-loop-2 text: worklet global scopes; url:worklets.html#concept-document-worklet-global-scopes @@ -1922,6 +1923,7 @@ BrowsingContextCommand = ( browsingContext.Navigate // browsingContext.Print // browsingContext.Reload // + browsingContext.SetUserAgent // browsingContext.SetViewport // browsingContext.TraverseHistory ) @@ -3448,6 +3450,58 @@ The [=remote end steps=] with |command parameters| are: +#### The browsingContext.setUserAgent Command #### {#command-browsingContext-setUserAgent} + +The browsingContext.setUserAgent command sets the +{{NavigatorID/userAgent}} string for a browsing context. + +
+ browsingContext.SetUserAgent = ( + method: "browsingContext.setUserAgent", + params: browsingContext.SetUserAgentParameters + ) + + browsingContext.SetUserAgentParameters = { + context: browsingContext.BrowsingContext, + userAgent: text / null, + } ++
+ EmptyResult ++
context
field of |command
+ parameters|.
+
+1. Let |context| be the result of [=trying=] to [=get a browsing context=] with
+ |context id|.
+
+1. Let |user agent| be the value of the userAgent
field of |command
+ parameters| if present, or null otherwise.
+
+1. If |user agent| is not null:
+
+ 1. Set |context|'s [=user agent=] to |user agent|.
+
+ 1. Otherwise, set |context|'s {{NavigatorID/userAgent}} to the
+ implementation-defined [=default `user-agent` value=].
+
+1. Return [=success=] with data null.
+
+