Skip to content

Commit 0b7e886

Browse files
Vikrant Kumar SinhaVikrant Kumar Sinha
Vikrant Kumar Sinha
authored and
Vikrant Kumar Sinha
committed
re create browser if not reachable
1 parent 0022acb commit 0b7e886

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/processSnapshot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default async (snapshot: Snapshot, ctx: Context): Promise<Record<string,
1717
javaScriptEnabled: ctx.config.enableJavaScript,
1818
userAgent: constants.CHROME_USER_AGENT,
1919
}
20-
if (!ctx.browser) {
20+
if (!ctx.browser?.isConnected()) {
2121
if (ctx.env.HTTP_PROXY || ctx.env.HTTPS_PROXY) launchOptions.proxy = { server: ctx.env.HTTP_PROXY || ctx.env.HTTPS_PROXY };
2222
ctx.browser = await chromium.launch(launchOptions);
2323
ctx.log.debug(`Chromium launched with options ${JSON.stringify(launchOptions)}`);

0 commit comments

Comments
 (0)