Skip to content

Commit

Permalink
Require an explicit origin for WebDriver BiDi automation (#436)
Browse files Browse the repository at this point in the history
* Require an explicit origin for WebDriver BiDi automation

In WebDriver classic permissions apply to all enviroments
that match the origin of the current environment. In WebDriver
BiDi using the current view as an input for commands is not
encouraged, therefore, this PR extends the WebDriver BiDi
command with an explicit origin parameter.

* Update index.html

Co-authored-by: Mike Taylor <[email protected]>

* Change to optional origin

* Update index.html

---------

Co-authored-by: Mike Taylor <[email protected]>
  • Loading branch information
OrKoN and miketaylr authored Jan 16, 2024
1 parent 037a40e commit 8972985
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1232,14 +1232,15 @@ <h2 id="automation">
<div class="algorithm">
<p>
To <dfn data-for="WebDriver">set a permission</dfn> given a {{PermissionDescriptor}}
|descriptor:PermissionDescriptor|, and a {{PermissionState}} |state:PermissionState|:
|descriptor:PermissionDescriptor|, a {{PermissionState}} |state:PermissionState|, and an
optional |origin|:
</p>
<ol>
<li>Let |settings| be the [=current settings object=].
<li>Let |target origin| be [=current settings object=]'s [=environment settings
object/origin=] if |origin| is null, or |origin| otherwise.
</li>
<li>Let |targets| be a <a>list</a> containing all [=environment settings objects=] whose
[=environment settings object/origin=] is [=same origin=] as the [=environment settings
object/origin=] of |settings|.
[=environment settings object/origin=] is [=same origin=] with |target origin|.
</li>
<li>Let |tasks| be an empty <a>list</a>.
</li>
Expand Down Expand Up @@ -1431,6 +1432,7 @@ <h6 id="webdriver-bidi-command-permissions-setPermission">
permissions.SetPermissionParameters = {
descriptor: permissions.PermissionDescriptor,
state: permissions.PermissionState,
origin: text,
}
</pre>
</dd>
Expand Down Expand Up @@ -1466,7 +1468,9 @@ <h6 id="webdriver-bidi-command-permissions-setPermission">
name|'s [=powerful feature/permission descriptor type=]. If this conversion
throws an exception, return [=error=] with [=error code=] [=invalid argument=].
</li>
<li>[=Set a permission=] with |typedDescriptor| and |state|.
<li>Let |origin| be the value of the `origin` field of |command parameters|.
</li>
<li>[=Set a permission=] with |typedDescriptor|, |state|, and |origin|.
</li>
<li>Return [=success=] with data `null`.
</li>
Expand Down

0 comments on commit 8972985

Please sign in to comment.