Skip to content

Commit

Permalink
Introduce "browsingContext.setUserAgent" command
Browse files Browse the repository at this point in the history
Bug: #448
  • Loading branch information
thiagowfx committed Nov 14, 2023
1 parent e0d496b commit 411f89a
Showing 1 changed file with 47 additions and 2 deletions.
49 changes: 47 additions & 2 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1880,6 +1880,7 @@ BrowsingContextCommand = (
browsingContext.Navigate //
browsingContext.Print //
browsingContext.Reload //
browsingContext.SetUserAgent //
browsingContext.SetViewport //
browsingContext.TraverseHistory
)
Expand Down Expand Up @@ -3406,6 +3407,50 @@ The [=remote end steps=] with |command parameters| are:

</div>

#### The browsingContext.setUserAgent Command #### {#command-browsingContext-setUserAgent}

The <dfn export for=commands>browsingContext.setUserAgent</dfn> command sets the
user agent string for a browsing context.

<dl>
<dt>Command Type</dt>
<dd>
<pre class="cddl remote-cddl">
browsingContext.SetUserAgent = (
method: "browsingContext.setUserAgent",
params: browsingContext.SetUserAgentParameters
)

browsingContext.SetUserAgentParameters = {
context: browsingContext.BrowsingContext,
userAgent: text / null,
}
</pre>
</dd>
<dt>Result Type</dt>
<dd>
<pre class="cddl">
EmptyResult
</pre>
</dd>
</dl>

<div algorithm="remote end steps for browsingContext.setUserAgent">

The [=remote end steps=] with |command parameters| are:

1. Let |context id| be the value of the <code>context</code> field of |command
parameters|.

1. Let |context| be the result of [=trying=] to [=get a browsing context=] with
|context id|.

TODO: Set user agent.

1. Return [=success=] with data null.

</div>

#### The browsingContext.setViewport Command #### {#command-browsingContext-setViewport}

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.
Expand Down Expand Up @@ -6530,7 +6575,7 @@ strong [=/map=] from handle ids to their corresponding objects.
script.InternalId = text;
</pre>

The <code>script.InternalId</code> type represents the id of
The <code>script.InternalId</code> type represents the id of
a previously serialized <code>script.RemoteValue</code> during
[=serialize as a remote value|serialization=].

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

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

1. Set the <code>internalId</code> field of
Expand Down

0 comments on commit 411f89a

Please sign in to comment.