Optionally specify Chromium user data directory with CHROMIUM_DATA_DIR environment variable

main
Elbert Alias 4 years ago
parent 644b4c79eb
commit ae845f79f3

@ -13,7 +13,11 @@ const {
resolve, resolve,
} = Wappalyzer } = 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 puppeteer
let chromiumArgs = [ let chromiumArgs = [
@ -22,7 +26,7 @@ let chromiumArgs = [
'--ignore-certificate-errors', '--ignore-certificate-errors',
'--allow-running-insecure-content', '--allow-running-insecure-content',
'--disable-web-security', '--disable-web-security',
'--user-data-dir=/tmp/chromium', `--user-data-dir=${CHROMIUM_DATA_DIR || '/tmp/chromium'}`,
] ]
let chromiumBin = CHROMIUM_BIN let chromiumBin = CHROMIUM_BIN

Loading…
Cancel
Save