@@ -200,8 +200,9 @@ spec: HTML; urlPrefix: https://html.spec.whatwg.org/multipage/
200
200
text: shared worker; url: workers.html#shared-workers
201
201
text: system visibility state; url: document-sequences.html#system-visibility-state
202
202
text: traversable navigable; url:document-sequences.html#traversable-navigable
203
- text: visible; url: document-sequences.html#system-visibility-state
204
203
text: traverse the history by a delta; url: browsing-the-web.html#traverse-the-history-by-a-delta
204
+ text: user agent; url: system-state.html#dom-navigator-useragent
205
+ text: visible; url: document-sequences.html#system-visibility-state
205
206
text: window open steps; url: window-object.html#window-open-steps
206
207
text: worker event loop; url: webappapis.html#worker-event-loop-2
207
208
text: worklet global scopes; url:worklets.html#concept-document-worklet-global-scopes
@@ -1922,6 +1923,7 @@ BrowsingContextCommand = (
1922
1923
browsingContext.Navigate //
1923
1924
browsingContext.Print //
1924
1925
browsingContext.Reload //
1926
+ browsingContext.SetUserAgent //
1925
1927
browsingContext.SetViewport //
1926
1928
browsingContext.TraverseHistory
1927
1929
)
@@ -3448,6 +3450,58 @@ The [=remote end steps=] with |command parameters| are:
3448
3450
3449
3451
</div>
3450
3452
3453
+ #### The browsingContext.setUserAgent Command #### {#command-browsingContext-setUserAgent}
3454
+
3455
+ The <dfn export for=commands>browsingContext.setUserAgent</dfn> command sets the
3456
+ {{NavigatorID/userAgent}} string for a browsing context.
3457
+
3458
+ <dl>
3459
+ <dt> Command Type</dt>
3460
+ <dd>
3461
+ <pre class="cddl remote-cddl">
3462
+ browsingContext.SetUserAgent = (
3463
+ method: "browsingContext.setUserAgent",
3464
+ params: browsingContext.SetUserAgentParameters
3465
+ )
3466
+
3467
+ browsingContext.SetUserAgentParameters = {
3468
+ context: browsingContext.BrowsingContext,
3469
+ userAgent: text / null,
3470
+ }
3471
+ </pre>
3472
+ </dd>
3473
+ <dt> Result Type</dt>
3474
+ <dd>
3475
+ <pre class="cddl">
3476
+ EmptyResult
3477
+ </pre>
3478
+ </dd>
3479
+ </dl>
3480
+
3481
+ <div algorithm="remote end steps for browsingContext.setUserAgent">
3482
+
3483
+ The [=remote end steps=] with |command parameters| are:
3484
+
3485
+ 1. Let |context id| be the value of the <code> context</code> field of |command
3486
+ parameters|.
3487
+
3488
+ 1. Let |context| be the result of [=trying=] to [=get a browsing context=] with
3489
+ |context id|.
3490
+
3491
+ 1. Let |user agent| be the value of the <code> userAgent</code> field of |command
3492
+ parameters| if present, or null otherwise.
3493
+
3494
+ 1. If |user agent| is not null:
3495
+
3496
+ 1. Set |context|'s [=user agent=] to |user agent|.
3497
+
3498
+ 1. Otherwise, set |context|'s {{NavigatorID/userAgent}} to the
3499
+ implementation-defined [=default `user-agent` value=] .
3500
+
3501
+ 1. Return [=success=] with data null.
3502
+
3503
+ </div>
3504
+
3451
3505
#### The browsingContext.setViewport Command #### {#command-browsingContext-setViewport}
3452
3506
3453
3507
The <dfn export for=commands>browsingContext.setViewport</dfn> command specific viewport characteristics (e.g. viewport width and viewport height) on the given top-level browsing context.
0 commit comments