We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5ce1b38 + ad53564 commit 6bee45cCopy full SHA for 6bee45c
backend/src/util/browser.js
@@ -14,7 +14,8 @@ let browser = null;
14
async function getBrowserContext() {
15
try {
16
if (browser instanceof puppeteer.Browser && browser.process() !== null) {
17
- return browser;
+ log.info('Puppeteer :: getBrowserContext reusing browser process');
18
+ return browser.createBrowserContext();
19
}
20
// To debug locally add {headless: false, devtools: true} in options
21
// make sure they are boolean and not string
@@ -57,6 +58,7 @@ async function closeBrowser() {
57
58
const pages = await browser.pages();
59
if (pages.length === 1) {
60
await browser.close();
61
+ browser = null;
62
} else {
63
log.warn('Puppeteer :: closeBrowser was called with pages open');
64
0 commit comments