diff --git a/src/crawler.ts b/src/crawler.ts index 39b1b2f5..3d390b30 100644 --- a/src/crawler.ts +++ b/src/crawler.ts @@ -594,7 +594,7 @@ export class Crawler { } extraChromeArgs() { - const args = []; + const args: string[] = []; if (this.params.lang) { if (this.params.profile) { logger.warn( @@ -605,6 +605,16 @@ export class Crawler { args.push(`--accept-lang=${this.params.lang}`); } } + + const extra = this.params.extraChromeArgs; + if (Array.isArray(extra) && extra.length > 0) { + for (const v of extra) { + if (v) { + args.push(String(v)); + } + } + } + return args; } diff --git a/src/util/argParser.ts b/src/util/argParser.ts index cd64e8fd..a6e7ac81 100644 --- a/src/util/argParser.ts +++ b/src/util/argParser.ts @@ -683,6 +683,13 @@ class ArgParser { "path to SSH known hosts file for SOCKS5 over SSH proxy connection", type: "string", }, + + extraChromeArgs: { + describe: + "Extra arguments to pass directly to the Chrome instance (space-separated or multiple --extraChromeArgs)", + type: "array", + default: [], + }, }); }