From 2e15256e7a7cd1004a10c1faf636cbe098ad9165 Mon Sep 17 00:00:00 2001 From: Elbert Alias <77259+AliasIO@users.noreply.github.com> Date: Fri, 14 Oct 2022 09:15:17 +1100 Subject: [PATCH] Add option to override Chromium args using env var --- src/drivers/npm/driver.js | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/drivers/npm/driver.js b/src/drivers/npm/driver.js index 89accd3d4..6a2653e39 100644 --- a/src/drivers/npm/driver.js +++ b/src/drivers/npm/driver.js @@ -10,18 +10,21 @@ const Wappalyzer = require('./wappalyzer') const { setTechnologies, setCategories, analyze, analyzeManyToMany, resolve } = Wappalyzer -const { CHROMIUM_BIN, CHROMIUM_DATA_DIR, CHROMIUM_WEBSOCKET } = process.env - -const chromiumArgs = [ - '--single-process', - '--no-sandbox', - '--no-zygote', - '--disable-gpu', - '--ignore-certificate-errors', - '--allow-running-insecure-content', - '--disable-web-security', - `--user-data-dir=${CHROMIUM_DATA_DIR || '/tmp/chromium'}`, -] +const { CHROMIUM_BIN, CHROMIUM_DATA_DIR, CHROMIUM_WEBSOCKET, CHROMIUM_ARGS } = + process.env + +const chromiumArgs = CHROMIUM_ARGS + ? CHROMIUM_ARGS.split(' ') + : [ + '--single-process', + '--no-sandbox', + '--no-zygote', + '--disable-gpu', + '--ignore-certificate-errors', + '--allow-running-insecure-content', + '--disable-web-security', + `--user-data-dir=${CHROMIUM_DATA_DIR || '/tmp/chromium'}`, + ] const extensions = /^([^.]+$|\.(asp|aspx|cgi|htm|html|jsp|php)$)/