GoogleChromeLabs/pptraas.com

Launch new tab instead of launch new browser

vincent178 opened this issue · 1 comments

Hi,

Thanks for the nice repo, it is very helpful. Just one issue:

app.all('*', async (request, response, next) => {
  response.locals.browser = await puppeteer.launch({
    dumpio: true,
    // headless: false,
    // executablePath: 'google-chrome',
    args: ['--no-sandbox', '--disable-setuid-sandbox'], // , '--disable-dev-shm-usage']
  });

  next(); // pass control on to routes.
});

This code shows that we create a new browser every time for a new request, this requires more memory and more load time than create a new tab for the same browser.

I wonder what's the thought behind this?

Thanks,
Vincent