[Question] How to launch Playwright server without incognito mode
See original GitHub issueWe want to launch the Playwright Server without incognito mode for user to connect to the browser remotely. The playwright server by default launches the browser in incognito mode. And hence, the browser extensions cannot be used in the incognito mode.
How can I disable the incognito mode while launching the playwright server? As per I checked from the command used to launch the browser at chrome://version/, it does not contain the --incognito flag, which is used to launch the browser in incognito.
I can set the flag ignoreDefaultArgs: true and pass the required arguments to the args object for launchServer() to launch the browser without incognito mode. Is there any other way for launching the server with persistent context? And why is --incognito not passed to the command while launching the browser in incognito?
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:5 (2 by maintainers)

Top Related StackOverflow Question
@ankur-lt Thank you for the explanation. This sounds like a possible scenario, but there are no plans to support it for now. I’ll leave this feature request open for further prioritization.
@dgozman , we want the ability to load extensions and use them in the browser. We are using the
launchServer()to launch the Playwright Server, for user to run their tests on the remote machine(https://www.lambdatest.com/support/docs/run-your-first-playwright-test/). This cannot be done in the incognito mode as the extensions are by default disabled in incognito mode. This will require the use of a persistent context(https://playwright.dev/docs/chrome-extensions), but thelaunchPersistentContext()method does not start the playwright server. So either:launchPersistentContext()method should should accept a param to set theLaunchTypetoserver, orlaunchServer()should accept a param to start the server with a persistent storage.