Puppeteer opens an empty tab in non-headless mode

You can add this to automatically close the first "blank" page whenever you open a new page.

  browser.on('targetcreated', async function f() {

  let pages = await browser.pages();

            if (pages.length > 1) {
                await pages[0].close();

                browser.off('targetcreated', f);
            }

        });

The solution is to use the existing tab/page (dont open a new one):

// launch the browser
var browser = await puppeteer.launch({ headless: false });

// get existing tab/page (first item in the array)
var [page] = await browser.pages();

// load barcode tracking website
await page.goto('https://orcascan.com');

Try this:

const page = await browser.newPage();
const pages = await browser.pages();
if (pages.length > 1) {
    await pages[0].close();
}

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.