Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions commands/analyse.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ async function analyse_core(options) {
throw ` url_input_file : "${URL_YAML_FILE}" is not a valid YAML file: ${error.code} at ${JSON.stringify(error.linePos)}.`
}

let additionalArgs = String(options.chrome_flags).split(" ");
let browserArgs = [
"--no-sandbox", // can't run inside docker without
"--disable-setuid-sandbox" // but security issues
]
"--disable-setuid-sandbox", // but security issues
].concat(additionalArgs);

// Add proxy conf in browserArgs
let proxy = {};
Expand Down Expand Up @@ -87,7 +88,7 @@ async function analyse_core(options) {
else {
await create_XLSX_report(reportObj, options);
}

}

function readProxy(proxyFile) {
Expand Down Expand Up @@ -136,4 +137,4 @@ function analyse(options) {
analyse_core(options).catch(e=>console.error("ERROR : \n", e))
}

module.exports = analyse;
module.exports = analyse;
7 changes: 6 additions & 1 deletion greenit
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ yargs(hideBin(process.argv))
description: 'Option to enable or disable web browser headless mode',
default: true
})
.option('chrome_flags', {
type: 'array',
description: 'Additional Chrome flags. Example: --chrome-flags="--flag1 --flag2"',
default: []
})
}, (argv) => {
require("./commands/analyse.js")(argv)
})
Expand All @@ -107,4 +112,4 @@ yargs(hideBin(process.argv))
.strict()
.demandCommand()
.help()
.argv
.argv