From 5e3a1f92440437a25ad4b51add2e3df9481757f7 Mon Sep 17 00:00:00 2001 From: aponb Date: Wed, 13 Aug 2025 18:46:54 +0200 Subject: [PATCH 1/2] feat: add extraChromeArgs support for passing custom Chrome flags --- src/crawler.ts | 12 +++++++++++- src/util/argParser.ts | 7 +++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/crawler.ts b/src/crawler.ts index 39b1b2f5a..62bc0c196 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 !== undefined && v !== null && v !== "") { + args.push(String(v)); + } + } + } + return args; } diff --git a/src/util/argParser.ts b/src/util/argParser.ts index cd64e8fd6..a6e7ac816 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: [], + }, }); } From 1f9068a77950477ee60666fdb820d5c80105e770 Mon Sep 17 00:00:00 2001 From: aponb Date: Mon, 25 Aug 2025 09:32:37 +0200 Subject: [PATCH 2/2] Update src/crawler.ts Co-authored-by: Ilya Kreymer --- src/crawler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crawler.ts b/src/crawler.ts index 62bc0c196..3d390b307 100644 --- a/src/crawler.ts +++ b/src/crawler.ts @@ -609,7 +609,7 @@ export class Crawler { const extra = this.params.extraChromeArgs; if (Array.isArray(extra) && extra.length > 0) { for (const v of extra) { - if (v !== undefined && v !== null && v !== "") { + if (v) { args.push(String(v)); } }