[Question] Ability to disconnect from browser server without closing contexts
See original GitHub issueHi, is it possible to disconnect from a browser server while keeping open the browser contexts that were opened?
In puppeteer, the browser.disconnect
method does this. It looks like playwright doesn’t have a disconnect
method, just a close
that disconnects and closes the browser contexts
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:9 (3 by maintainers)
Top Results From Across the Web
ASP.NET Web API Internal server error when client is ...
This issue may be related to ASP.NET Web API OperationCanceledException when browser cancels the request, however the accepted solution does not ...
Read more >How to prevent SSH from disconnecting if it's been idle for a ...
If you would like to quickly terminate the session as soon as the server does not respond anymore, you should choose a low...
Read more >How To Use Contexts in Go - DigitalOcean
Context that includes information about the client making the request and will end if the client disconnects before the request is finished. By ......
Read more >I want to disable search in the address bar and browser.urlbar ...
I have repeatedly removed the ability to search from the URL BAR from my web browser and FF keeps putting it back. Dammit!!...
Read more >Session Management - OWASP Cheat Sheet Series
Web applications must provide a visible and easily accessible logout (logoff, exit, or close session) button that is available on the web application...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
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
I am also in need of this feature.
My use case: I am running automated tests for applications in an embedded browser (powered by Chromium) and I am connecting Playwright using
Chromium.connectOverCDP()
. The embedded browser (deliberately) has limited functionality sonewPage()
is not valid here and neither isbrowserContext.close()
. There can only ever be one browser context and one page per instance of the desktop application. In the jest environment setup, I connect to usingconnectOverCDP()
however in the environment teardown I cannot usebrowserContext.close()
as closing the browser context will close the desktop application (and therefore will disrupt other tests).In puppeteer, I used to use
browser.disconnect()
and this worked because it does not try to close the browserContext, allowing my jest tests to finish correctly, with no open processes. I would like to know how to achieve the same result in Playwright or suggest a similar feature for a future release.Thanks for clarifying. Unfortunately Jest force-kills test processes that don’t terminate gracefully, so that’s not an option for me:
I’ll be sticking to Puppeteer for now, thanks for your help anyways!