Skip to content

Commit 438c6b7

Browse files
author
Thiago Perrotta
committed
Introduce "browsingContext.setUserAgent" command
Bug: #448
1 parent e0d496b commit 438c6b7

File tree

1 file changed

+57
-3
lines changed

1 file changed

+57
-3
lines changed

index.bs

Lines changed: 57 additions & 3 deletions
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
@@ -1880,6 +1881,7 @@ BrowsingContextCommand = (
18801881
browsingContext.Navigate //
18811882
browsingContext.Print //
18821883
browsingContext.Reload //
1884+
browsingContext.SetUserAgent //
18831885
browsingContext.SetViewport //
18841886
browsingContext.TraverseHistory
18851887
)
@@ -3406,6 +3408,58 @@ The [=remote end steps=] with |command parameters| are:
34063408

34073409
</div>
34083410

3411+
#### The browsingContext.setUserAgent Command #### {#command-browsingContext-setUserAgent}
3412+
3413+
The <dfn export for=commands>browsingContext.setUserAgent</dfn> command sets the
3414+
{{NavigatorID/userAgent}} string for a browsing context.
3415+
3416+
<dl>
3417+
<dt>Command Type</dt>
3418+
<dd>
3419+
<pre class="cddl remote-cddl">
3420+
browsingContext.SetUserAgent = (
3421+
method: "browsingContext.setUserAgent",
3422+
params: browsingContext.SetUserAgentParameters
3423+
)
3424+
3425+
browsingContext.SetUserAgentParameters = {
3426+
context: browsingContext.BrowsingContext,
3427+
userAgent: text / null,
3428+
}
3429+
</pre>
3430+
</dd>
3431+
<dt>Result Type</dt>
3432+
<dd>
3433+
<pre class="cddl">
3434+
EmptyResult
3435+
</pre>
3436+
</dd>
3437+
</dl>
3438+
3439+
<div algorithm="remote end steps for browsingContext.setUserAgent">
3440+
3441+
The [=remote end steps=] with |command parameters| are:
3442+
3443+
1. Let |context id| be the value of the <code>context</code> field of |command
3444+
parameters|.
3445+
3446+
1. Let |context| be the result of [=trying=] to [=get a browsing context=] with
3447+
|context id|.
3448+
3449+
1. Let |user agent| be the value of the <code>userAgent</code> field of |command
3450+
parameters| if present, or null otherwise.
3451+
3452+
1. If |user agent| is not null:
3453+
3454+
1. Set |context|'s [=user agent=] to |user agent|.
3455+
3456+
1. Otherwise, set |context|'s {{NavigatorID/userAgent}} to the
3457+
implementation-defined [=default `user-agent` value=].
3458+
3459+
1. Return [=success=] with data null.
3460+
3461+
</div>
3462+
34093463
#### The browsingContext.setViewport Command #### {#command-browsingContext-setViewport}
34103464

34113465
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.
@@ -6530,7 +6584,7 @@ strong [=/map=] from handle ids to their corresponding objects.
65306584
script.InternalId = text;
65316585
</pre>
65326586

6533-
The <code>script.InternalId</code> type represents the id of
6587+
The <code>script.InternalId</code> type represents the id of
65346588
a previously serialized <code>script.RemoteValue</code> during
65356589
[=serialize as a remote value|serialization=].
65366590

@@ -7526,7 +7580,7 @@ To <dfn>set internal ids if needed</dfn> given |serialization internal map|,
75267580
1. If |previously serialized remote value| does not have a field
75277581
<code>internalId</code>, run the following steps:
75287582

7529-
1. Let |internal id| be the string representation of a [[!RFC4122|UUID]]
7583+
1. Let |internal id| be the string representation of a [[!RFC4122|UUID]]
75307584
based on truly random, or pseudo-random numbers.
75317585

75327586
1. Set the <code>internalId</code> field of

0 commit comments

Comments
 (0)