Add option to override Chromium args using env var

main
Elbert Alias 2 years ago
parent 8b72e07b6b
commit 2e15256e7a

@ -10,9 +10,12 @@ const Wappalyzer = require('./wappalyzer')
const { setTechnologies, setCategories, analyze, analyzeManyToMany, resolve } = const { setTechnologies, setCategories, analyze, analyzeManyToMany, resolve } =
Wappalyzer Wappalyzer
const { CHROMIUM_BIN, CHROMIUM_DATA_DIR, CHROMIUM_WEBSOCKET } = process.env const { CHROMIUM_BIN, CHROMIUM_DATA_DIR, CHROMIUM_WEBSOCKET, CHROMIUM_ARGS } =
process.env
const chromiumArgs = [ const chromiumArgs = CHROMIUM_ARGS
? CHROMIUM_ARGS.split(' ')
: [
'--single-process', '--single-process',
'--no-sandbox', '--no-sandbox',
'--no-zygote', '--no-zygote',
@ -21,7 +24,7 @@ const chromiumArgs = [
'--allow-running-insecure-content', '--allow-running-insecure-content',
'--disable-web-security', '--disable-web-security',
`--user-data-dir=${CHROMIUM_DATA_DIR || '/tmp/chromium'}`, `--user-data-dir=${CHROMIUM_DATA_DIR || '/tmp/chromium'}`,
] ]
const extensions = /^([^.]+$|\.(asp|aspx|cgi|htm|html|jsp|php)$)/ const extensions = /^([^.]+$|\.(asp|aspx|cgi|htm|html|jsp|php)$)/