From 47b02bedd685eaaecf82ffc3e8e1ef8a416b1333 Mon Sep 17 00:00:00 2001 From: younglim Date: Sat, 25 May 2024 18:48:13 +0800 Subject: [PATCH] Push userDataDir fix on non-headless browser pool crash --- crawlers/crawlSitemap.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crawlers/crawlSitemap.js b/crawlers/crawlSitemap.js index 41d0bd22..7ad3b556 100644 --- a/crawlers/crawlSitemap.js +++ b/crawlers/crawlSitemap.js @@ -115,7 +115,8 @@ const crawlSitemap = async ( launchContext: { launcher: constants.launcher, launchOptions: getPlaywrightLaunchOptions(browser), - userDataDir: userDataDirectory || '', + // Bug in Chrome which causes brwoser pool crash when userDataDirectory is set in non-headless mode + userDataDir: userDataDirectory ? (process.env.CRAWLEE_HEADLESS !== '0' ? userDataDirectory : '') : '', }, retryOnBlocked: true, browserPoolOptions: {