I want to use this as setting for my app. Browser needs to be hidden or shown depending on checkbox value. I know that there is headless mode, but is there any way to this dynamically without instance recreating?
I thought that I could use an old instance which was shown for example, with old page data and new headless parameter but this doesn't seem to work.
In the config file Playwright.config.js you use
use: { headless: true, },here the same topic: How to run Playwright in headless mode?