-
Notifications
You must be signed in to change notification settings - Fork 44
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
Support user contexts #570
Conversation
2568aed
to
19d010e
Compare
78bd343
to
9eb17f0
Compare
dd1533d
to
a1240f9
Compare
2df3c2e
to
13b5804
Compare
a7d6f50
to
57acfff
Compare
index.bs
Outdated
|
||
User contexts other than the [=default user context=] have a <dfn>user context | ||
id</dfn>, which is a string set upon context creation. The [=default user | ||
context=]'s does not have a [=user context id=]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be easier to treat the default context id as undefined.
e303f6b
to
e384195
Compare
This gives us an explicit set of top-level user contexts to work with, and makes the association between nagigables and user contexts clearer.
This returns a list of all user contexts. At the moment it doesn't contain any information about the browsing contexts in each user context (so you'd have to cross-reference with browsingContext.getTree).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, thanks!
I added a suggestion for making the lookup of user context by id more explicit, but I'm happy to approve the PR since I think basically all the behaviour makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
SHA: 55adba6 Reason: push, by OrKoN Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
User Contexts allow basic isolation of the web content state and parallelization of test runs without paying the costs of launching a fresh/multiple browser processes. In this proposal, there is no session created for the user context: multiple user contexts are managed by the same session. The advantage is that the same session can create a fresh state for its operations. In practical terms, we want to have something that would allow us to implement https://pptr.dev/api/puppeteer.browsercontext/#example In Chrome, that corresponds to an incognito window (but you can have multiple for automation).
Issue #289
Related links:
Open questions/TODOs:
Preview | Diff