Skip to content

Commit

Permalink
feat: Support for passing args to carlo
Browse files Browse the repository at this point in the history
Ability to specify additional arguments to
carlo through an environment variable (NDB_CARLO_ARGS)

Ref GoogleChromeLabs#238
  • Loading branch information
kumarvi authored and alexkozy committed Sep 12, 2019
1 parent a4ab9a3 commit d73380f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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.')
Expand Down

0 comments on commit d73380f

Please sign in to comment.