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,
} = 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

Loading…
Cancel
Save