Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add userContext field to WebDriver BiDi's setPermission #438

Merged
merged 3 commits into from
Mar 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1234,15 +1234,16 @@ <h2 id="automation">
<div class="algorithm">
<p>
To <dfn data-for="WebDriver">set a permission</dfn> given a {{PermissionDescriptor}}
|descriptor:PermissionDescriptor|, a {{PermissionState}} |state:PermissionState|, and an
optional |origin|:
|descriptor:PermissionDescriptor|, a {{PermissionState}} |state:PermissionState|, an
optional |origin|, and an optional |user agent|:
</p>
<ol>
<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=] with |target origin|.
[=environment settings object/origin=] is [=same origin=] with |target origin|, and which
belong to the |user agent| if provided, or all user agents otherwise.
</li>
<li>Let |tasks| be an empty <a>list</a>.
</li>
Expand Down Expand Up @@ -1436,6 +1437,7 @@ <h6 id="webdriver-bidi-command-permissions-setPermission">
descriptor: permissions.PermissionDescriptor,
state: permissions.PermissionState,
origin: text,
userContext?: text,
}
</pre>
</dd>
Expand All @@ -1462,6 +1464,9 @@ <h6 id="webdriver-bidi-command-permissions-setPermission">
</li>
<li>Let |state| be the value of the `state` field of |command parameters|.
</li>
<li>Let |user context id| be the value of the `userContext` field of |command
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to understand what a "user context" looks like... in https://w3c.github.io/webdriver-bidi/#user-context, it seems like a data structure that has an ID, has a storage partition, and has a collection of traversables? Is that right? Or is it strictly just a unique identifier and the rest happens by magic?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The user context roughly corresponds to the user agent of the infra spec definition (except that the WebDriver can identify them). User context IDs are unique, except for the default user context (identified as "default"). In implementations, a user context is an incognito window in Chrome or a container in Firefox.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miketaylr is there anything else I could try to clarify?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OrKoN apologies, was OOO last week. Thanks for the clarification - makes sense. Did you intend to close this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, closing was not intended.

parameters|, if present, and `default` otherwise.
</li>
<li>If |state| is an inappropriate [=permission state=] for any
implementation-defined reason, return [=error=] with [=error code=] [=invalid
argument=].
Expand All @@ -1473,7 +1478,11 @@ <h6 id="webdriver-bidi-command-permissions-setPermission">
</li>
<li>Let |origin| be the value of the `origin` field of |command parameters|.
</li>
<li>[=Set a permission=] with |typedDescriptor|, |state|, and |origin|.
<li>Let |user agent| be the [=user agent=] that represents the [=user context=]
with the id |user context id|.
</li>
<li>[=Set a permission=] with |typedDescriptor|, |state|, |origin|, and |user
agent|.
</li>
<li>Return [=success=] with data `null`.
</li>
Expand Down
Loading