Is there any possible way to hide and show browser via Playwright?

1k Views Asked by At

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.

1

There are 1 best solutions below

0
Mteheran On

In the config file Playwright.config.js you use

use: { headless: true, },

here the same topic: How to run Playwright in headless mode?