From ae845f79f329d936a83563530ee2aa9967da20ad Mon Sep 17 00:00:00 2001 From: Elbert Alias <77259+AliasIO@users.noreply.github.com> Date: Wed, 2 Sep 2020 12:42:21 +1000 Subject: [PATCH] Optionally specify Chromium user data directory with CHROMIUM_DATA_DIR environment variable --- src/drivers/npm/driver.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/drivers/npm/driver.js b/src/drivers/npm/driver.js index babfc5be2..de9df8935 100644 --- a/src/drivers/npm/driver.js +++ b/src/drivers/npm/driver.js @@ -13,7 +13,11 @@ const { resolve, } = Wappalyzer -const { AWS_LAMBDA_FUNCTION_NAME, CHROMIUM_BIN } = process.env +const { + AWS_LAMBDA_FUNCTION_NAME, + CHROMIUM_BIN, + CHROMIUM_DATA_DIR, +} = process.env let puppeteer let chromiumArgs = [ @@ -22,7 +26,7 @@ let chromiumArgs = [ '--ignore-certificate-errors', '--allow-running-insecure-content', '--disable-web-security', - '--user-data-dir=/tmp/chromium', + `--user-data-dir=${CHROMIUM_DATA_DIR || '/tmp/chromium'}`, ] let chromiumBin = CHROMIUM_BIN