Open Chrome without it taking focus (Puppeteer)

511 Views Asked by At

I'm using Puppeteer to launch multiple browsers - Every few minutes, it'll reopen the browsers. This works fine, except it's constantly opening browsers and focusing the tabs, bothering me while I'm trying to use the computer. Due to what I'm trying to do, I have a few specific problems that ruin any ideas I can come up with, like

  • Don't close the browser, clear the cache! (I'm using a plugin that doesn't allow you to clear cache like this, it forces you to close + restart the browser)
  • Use headless: true! (Again, due to my use case, the plugin sadly doesn't work with headless: true)

Tl;dr, I need a way to open a browser (that can be used in a Puppeteer) that won't take focus, without just setting headless:true

If you have any advice or ideas, that'd be awesome!

Edit: My OS is Windows

0

There are 0 best solutions below