Search code examples
google-chrome-devtoolspuppeteer

Puppeteer opens an empty tab in non-headless mode


When running puppeteer(last version from npm - 0.13.0) and passing args to

puppeteer.launch({ headless: false })

the chrome is opened with an empty page as a first tab and opens the actual page from the script in the second tab.

const page = await browser.newPage(); Is it an expected behavior? Or a bug?


Solution

  • Yes that's expected behavior. It works exactly as opening a chrome browser. If you closed that first tab the browser will close just as using the chrome browser. There needs to be at least one tab open for the browser to remain open. If you use await browser.pages() upon launching the browser, that will return all the pages open currently, which should be 1 about:blank page.