Skip to content

Commit

Permalink
feat: add CHROME_OPTIONS flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jniles committed Jan 20, 2022
1 parent 1c9d1b8 commit e2e122b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,21 @@ let cluster;
*/
const launch = async () => {
debug('#launch(): setting up puppeteer cluster');
cluster = await Cluster.launch({

const options = {
concurrency : Cluster.CONCURRENCY_CONTEXT, // incognito windows
maxConcurrency : 2,
});
};

if (process.env.CHROME_OPTIONS) {
options.puppteerOptions = {
args : process.env.CHROME_OPTIONS.split(' '),
};

debug('#launch() using extra launch arguments:', process.env.CHROME_OPTIONS);
}

cluster = await Cluster.launch(options);

debug('#launch(): configuring PDF rendering task');

Expand Down

0 comments on commit e2e122b

Please sign in to comment.