From d73380fea33635fdec7450b7c3c02b665aa25e88 Mon Sep 17 00:00:00 2001 From: Vignesh Kumar Date: Tue, 3 Sep 2019 20:34:02 +0530 Subject: [PATCH] feat: Support for passing args to carlo Ability to specify additional arguments to carlo through an environment variable (NDB_CARLO_ARGS) Ref #238 --- lib/launcher.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/launcher.js b/lib/launcher.js index 223456a5..233df315 100644 --- a/lib/launcher.js +++ b/lib/launcher.js @@ -18,6 +18,7 @@ process.on('unhandledRejection', error => { async function launch() { let app; + const carloArgs = process.env.NDB_CARLO_ARGS ? JSON.parse(process.env.NDB_CARLO_ARGS) : {}; try { app = await carlo.launch({ bgcolor: '#242424', @@ -28,7 +29,8 @@ async function launch() { argv: process.argv, nodeExecPath: process.execPath })).toString('base64') - } + }, + ...carloArgs }); } catch (e) { if (e.message !== 'Could not start the browser or the browser was already running with the given profile.')