0

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.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Bannyk
  • 1
  • 1
  • Related: [Puppeteer/Playwright is it possible to set the browser visible when launching as headless](https://stackoverflow.com/questions/67259683/puppeteer-playwright-is-it-possible-to-set-the-browser-visible-when-launching-as). Might be an [xy problem](https://meta.stackexchange.com/a/233676/399876) since the browser runs on the server, so the client can't see it regardless of whether it's headless or not. – ggorlen Aug 20 '23 at 18:53
  • No you cant do this dynamically without creating a new instance. Sorry. What you could do is save all the current cookies, reload the browser instance setting headless to true/false and then reload the cookies so you are back to where you originally was – Ocean Airdrop Aug 27 '23 at 20:44

0 Answers0