Skip to content

Commit db7fc48

Browse files
author
Thiago Perrotta
committed
Introduce "browsingContext.setUserAgent" command
Bug: #448
1 parent a827e75 commit db7fc48

File tree

1 file changed

+55
-1
lines changed

1 file changed

+55
-1
lines changed

index.bs

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,9 @@ spec: HTML; urlPrefix: https://html.spec.whatwg.org/multipage/
200200
text: shared worker; url: workers.html#shared-workers
201201
text: system visibility state; url: document-sequences.html#system-visibility-state
202202
text: traversable navigable; url:document-sequences.html#traversable-navigable
203-
text: visible; url: document-sequences.html#system-visibility-state
204203
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
205206
text: window open steps; url: window-object.html#window-open-steps
206207
text: worker event loop; url: webappapis.html#worker-event-loop-2
207208
text: worklet global scopes; url:worklets.html#concept-document-worklet-global-scopes
@@ -1922,6 +1923,7 @@ BrowsingContextCommand = (
19221923
browsingContext.Navigate //
19231924
browsingContext.Print //
19241925
browsingContext.Reload //
1926+
browsingContext.SetUserAgent //
19251927
browsingContext.SetViewport //
19261928
browsingContext.TraverseHistory
19271929
)
@@ -3448,6 +3450,58 @@ The [=remote end steps=] with |command parameters| are:
34483450

34493451
</div>
34503452

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+
34513505
#### The browsingContext.setViewport Command #### {#command-browsingContext-setViewport}
34523506

34533507
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

Comments
 (0)