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

Conversation

OrKoN
Copy link
Contributor

@OrKoN OrKoN commented Jan 30, 2024

User contexts in WebDriver BiDi represents the same concepts as the user agents in the infra spec: https://w3c.github.io/webdriver-bidi/#user-contexts According to the infra definition a user agent can be a user profile or a private browsing window.

This PR adds an ability for the automation client to configure which "user agent" should the permissions apply too.

closes #439

The following tasks have been completed:

  • Modified Web platform tests (link)

Implementation commitment:


Preview | Diff

@OrKoN OrKoN force-pushed the orkon/user-context-id branch 2 times, most recently from dc5b1e8 to d00fab7 Compare January 30, 2024 20:48
@OrKoN OrKoN closed this Jan 30, 2024
@OrKoN OrKoN reopened this Jan 30, 2024
@OrKoN OrKoN closed this Jan 31, 2024
@OrKoN OrKoN reopened this Jan 31, 2024
User contexts in WebDriver BiDi represents the same concepts
as the user agents in the infra spec: https://w3c.github.io/webdriver-bidi/#user-contexts
According to the infra definition a user agent can be a user profile or a private browsing
window.

This PR adds an ability for the automation client to configure which "user agent"
should the permissions apply too.
@OrKoN
Copy link
Contributor Author

OrKoN commented Jan 31, 2024

@miketaylr could you please take a look? Does the definition like this make sense from the perspective of the permissions spec? It looks like until now the spec didn't deal with multiple user agents at once.

@miketaylr miketaylr self-requested a review February 5, 2024 23:07
Copy link
Member

@miketaylr miketaylr left a comment

Choose a reason for hiding this comment

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

(apologies for the delay here!)

@@ -1459,6 +1461,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.

OrKoN added a commit to GoogleChromeLabs/chromium-bidi that referenced this pull request Feb 22, 2024
This PR adds `goog:` prefixed user context to allow use cases required
by Puppeteer. Once permissions spec issue is resolved
w3c/permissions#438 we can remove the prefix.
@OrKoN
Copy link
Contributor Author

OrKoN commented Feb 29, 2024

Ah, sorry, it got auto-closed since I moved on with the vendor-prefixed implementation for now.

@OrKoN OrKoN reopened this Feb 29, 2024
Copy link
Member

@miketaylr miketaylr left a comment

Choose a reason for hiding this comment

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

This LGTM, mind taking a look @marcoscaceres?

@OrKoN - do we have interest from another vendor to implement this?

@OrKoN
Copy link
Contributor Author

OrKoN commented Mar 4, 2024

I have not received any feedback from other vendors on this particular change (except for the general implementation interest for WebDriver BiDi/permissions).

Copy link
Member

@marcoscaceres marcoscaceres left a comment

Choose a reason for hiding this comment

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

This seems fine.

@miketaylr
Copy link
Member

  Error: ROR] Couldn't find "session" in this document or other cited documents: [dom], [fetch], [html], [infra], [permissions-policy], [url], [w3c-process], [webdriver], and [webidl].

@miketaylr
Copy link
Member

@OrKoN mind rebasing? Then we can merge.

@OrKoN
Copy link
Contributor Author

OrKoN commented Mar 8, 2024

@miketaylr @marcoscaceres thanks for reviewing, I have re-based.

@miketaylr miketaylr merged commit 645867d into w3c:main Mar 8, 2024
2 checks passed
github-actions bot added a commit that referenced this pull request Mar 8, 2024
SHA: 645867d
Reason: push, by miketaylr

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@OrKoN OrKoN deleted the orkon/user-context-id branch March 8, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WebDriver BiDi: support user contexts in setPermission
3 participants