Skip to content
Snippets Groups Projects

Bring in changes from MR #18: Add a possibility to pass extra arguments to puppeteer

Merged Bring in changes from MR #18: Add a possibility to pass extra arguments to puppeteer
Merged Boris Budini requested to merge mr-18-fix into master
3 files
+ 12
0
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 6
0
@@ -8,6 +8,10 @@ const fs = require("fs");
@@ -8,6 +8,10 @@ const fs = require("fs");
// const writeFileAsync = promisify(fs.writeFile);
// const writeFileAsync = promisify(fs.writeFile);
const replaceExt = require("replace-ext");
const replaceExt = require("replace-ext");
 
function commaSeparatedList(value) {
 
return value.split(',');
 
}
 
program
program
.version(require("../package.json").version)
.version(require("../package.json").version)
.arguments("[inputPath]")
.arguments("[inputPath]")
@@ -40,6 +44,7 @@ program
@@ -40,6 +44,7 @@ program
"adding custom pagedjs handlers. The option can be repeated.",
"adding custom pagedjs handlers. The option can be repeated.",
collect, [])
collect, [])
.option("--browserEndpoint <browserEndpoint>", "Use a remote Chrome server with browserWSEndpoint")
.option("--browserEndpoint <browserEndpoint>", "Use a remote Chrome server with browserWSEndpoint")
 
.option("--browserArgs <browserArgs>", "Launch Chrome with comma separated args", commaSeparatedList)
.parse(process.argv);
.parse(process.argv);
function collect(value, previous) {
function collect(value, previous) {
@@ -117,6 +122,7 @@ if (typeof input === "string") {
@@ -117,6 +122,7 @@ if (typeof input === "string") {
additionalScripts: program.additionalScript,
additionalScripts: program.additionalScript,
browserEndpoint: program.browserEndpoint,
browserEndpoint: program.browserEndpoint,
timeout: program.timeout,
timeout: program.timeout,
 
browserArgs: program.browserArgs
};
};
if (program.forceTransparentBackground) {
if (program.forceTransparentBackground) {