Support browser contexts to launch different sessions
See original GitHub issueSupport browser contexts (Target.createBrowserContext) so to avoid launching multiple instances if one wants a pristine session. See proposal https://github.com/GoogleChrome/puppeteer/issues/66 and original discussion at https://github.com/cyrus-and/chrome-remote-interface/issues/118.
A viable user scenario might be testing several users logged in simultaneously into the service. We might expose browser contexts as a string literal option to the browser.newPage:
browser.newPage(); // creates a new page in a default browser context
browser.newPage({ context: 'default' }); // same as previous call
browser.newPage({ context: 'another-context' }); // creates a page in another browser context
Issue Analytics
- State:
- Created 6 years ago
- Reactions:197
- Comments:79 (17 by maintainers)
Top Results From Across the Web
What is a BrowserContext in the Node library Puppeteer?
BrowserContexts provide a way to operate multiple independent browser sessions. When a browser is launched, it has a single BrowserContext used ...
Read more >BrowserContext | Playwright - CukeTest
BrowserContexts provide a way to operate multiple independent browser sessions. If a page opens another page, e.g. with a window.open call, the popup...
Read more >Observations running 2 million headless sessions
We're excited to announce that we've recently just crossed over 2 million sessions served! That's millions of screenshots generated, ...
Read more >Multi-page scenarios | Playwright
Playwright can create multiple browser contexts within a single scenario. This is useful when you want to test for multi-user functionality, like chat....
Read more >Creating a launch entry - IBM
In the Launch in Context application, click New Launch Entry. ... console for an operational management product that you want to open in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, I got this working. Thanks for the tip, @ks07 .
UPDATE (2017-11-04): I’ve updated the example with a suggestion on how to close the page and its context.
Any updates to this issue now that pptr has hit v1.0.0? Supporting page contexts for isolations of sessions without having to make separate browser instances seems like a feature that I’d really like to see implemented!