From 61fbc1f0ccf6b3b711b53865ea5de31742590c8c Mon Sep 17 00:00:00 2001 From: 0xluckycoder Date: Mon, 5 Jan 2026 23:38:35 +0530 Subject: [PATCH 1/7] cli --- src/cli.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/cli.ts b/src/cli.ts index e1a623e78b..f3f8071f60 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -168,6 +168,11 @@ export const cliOptions = { describe: 'Additional arguments for Chrome. Only applies when Chrome is launched by chrome-devtools-mcp.', }, + ignoreDefaultChromeArg: { + type: 'array', + describe: + 'Explicitly disable default arguments for Chrome. Only applies when Chrome is launched by chrome-devtools-mcp.', + }, categoryEmulation: { type: 'boolean', default: true, @@ -229,6 +234,10 @@ export function parseArguments(version: string, argv = process.argv) { `$0 --chrome-arg='--no-sandbox' --chrome-arg='--disable-setuid-sandbox'`, 'Launch Chrome without sandboxes. Use with caution.', ], + [ + `$0 --ignore-default-chrome-arg='--disable-extensions'`, + 'Disable the default arguments provided by Puppeteer. Use with caution.', + ], ['$0 --no-category-emulation', 'Disable tools in the emulation category'], [ '$0 --no-category-performance', From 34912f6e198eede65e762a6b0ed4fc53cf09c03d Mon Sep 17 00:00:00 2001 From: 0xluckycoder Date: Thu, 8 Jan 2026 22:08:27 +0530 Subject: [PATCH 2/7] ignoreDefaultArg support --- src/browser.ts | 14 +++++++++++--- src/main.ts | 10 +++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/browser.ts b/src/browser.ts index e7dffd8db4..e65a634b08 100644 --- a/src/browser.ts +++ b/src/browser.ts @@ -142,11 +142,13 @@ interface McpLaunchOptions { width: number; height: number; }; - args?: string[]; + chromeArgs?: string[]; + ignoreDefaultChromeArgs?: string[]; devtools: boolean; } export async function launch(options: McpLaunchOptions): Promise { + console.log('🔥', options); const {channel, executablePath, headless, isolated} = options; const profileDirName = channel && channel !== 'stable' @@ -167,9 +169,14 @@ export async function launch(options: McpLaunchOptions): Promise { } const args: LaunchOptions['args'] = [ - ...(options.args ?? []), - '--hide-crash-restore-bubble', + ...(options.chromeArgs ?? []), + '--hide-crash-resore-bubble', ]; + const ignoreDefaultArgs: LaunchOptions['ignoreDefaultArgs'] = + options.ignoreDefaultChromeArgs ?? false; + + console.log(ignoreDefaultArgs); + if (headless) { args.push('--screen-info={3840x2160}'); } @@ -194,6 +201,7 @@ export async function launch(options: McpLaunchOptions): Promise { pipe: true, headless, args, + ignoreDefaultArgs: ignoreDefaultArgs, acceptInsecureCerts: options.acceptInsecureCerts, handleDevToolsAsPage: true, }); diff --git a/src/main.ts b/src/main.ts index ab6ee3019c..049214d548 100644 --- a/src/main.ts +++ b/src/main.ts @@ -54,9 +54,12 @@ server.server.setRequestHandler(SetLevelRequestSchema, () => { let context: McpContext; async function getContext(): Promise { - const extraArgs: string[] = (args.chromeArg ?? []).map(String); + const chromeArgs: string[] = (args.chromeArg ?? []).map(String); + const ignoreDefaultChromeArgs: string[] = ( + args.ignoreDefaultChromeArg ?? [] + ).map(String); if (args.proxyServer) { - extraArgs.push(`--proxy-server=${args.proxyServer}`); + chromeArgs.push(`--proxy-server=${args.proxyServer}`); } const devtools = args.experimentalDevtools ?? false; const browser = @@ -78,7 +81,8 @@ async function getContext(): Promise { userDataDir: args.userDataDir, logFile, viewport: args.viewport, - args: extraArgs, + chromeArgs, + ignoreDefaultChromeArgs, acceptInsecureCerts: args.acceptInsecureCerts, devtools, }); From 88df68ff40648a32619d0564d1fb5f3161dd6cb2 Mon Sep 17 00:00:00 2001 From: 0xluckycoder Date: Thu, 8 Jan 2026 22:10:04 +0530 Subject: [PATCH 3/7] rename args to chromeArgs --- tests/browser.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/browser.test.ts b/tests/browser.test.ts index 45c09a3c22..aad6eec9c1 100644 --- a/tests/browser.test.ts +++ b/tests/browser.test.ts @@ -82,7 +82,7 @@ describe('browser', () => { userDataDir: folderPath, executablePath: executablePath(), devtools: false, - args: ['--remote-debugging-port=0'], + chromeArgs: ['--remote-debugging-port=0'], }); try { const connectedBrowser = await ensureBrowserConnected({ From 35d549e2975c3ff45580e3c2efe738f4fbbd1c5a Mon Sep 17 00:00:00 2001 From: 0xluckycoder Date: Thu, 8 Jan 2026 22:10:38 +0530 Subject: [PATCH 4/7] test coverage --- tests/cli.test.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/cli.test.ts b/tests/cli.test.ts index 1312e630b5..7ef8fddc8a 100644 --- a/tests/cli.test.ts +++ b/tests/cli.test.ts @@ -132,6 +132,7 @@ describe('cli args parsing', () => { `--chrome-arg='--no-sandbox'`, `--chrome-arg='--disable-setuid-sandbox'`, ]); + console.log('assert log -> ', args); assert.deepStrictEqual(args, { ...defaultArgs, _: [], @@ -143,6 +144,31 @@ describe('cli args parsing', () => { }); }); + it('parses ignore chrome args', async () => { + const args = parseArguments('1.0.0', [ + 'node', + 'main.js', + `--ignore-default-chrome-arg='--disable-extensions'`, + `--ignore-default-chrome-arg='--disable-cancel-all-touches'`, + ]); + console.log('assert log -> ', args); + assert.deepStrictEqual(args, { + ...defaultArgs, + _: [], + headless: false, + $0: 'npx chrome-devtools-mcp@latest', + channel: 'stable', + 'ignore-default-chrome-arg': [ + '--disable-extensions', + '--disable-cancel-all-touches', + ], + ignoreDefaultChromeArg: [ + '--disable-extensions', + '--disable-cancel-all-touches', + ], + }); + }); + it('parses wsEndpoint with ws:// protocol', async () => { const args = parseArguments('1.0.0', [ 'node', From 517e5288838afb06bd714fae8a2e4d1c33e2c83b Mon Sep 17 00:00:00 2001 From: 0xluckycoder Date: Fri, 9 Jan 2026 21:21:55 +0530 Subject: [PATCH 5/7] remove trailing logs --- src/browser.ts | 3 --- tests/cli.test.ts | 2 -- 2 files changed, 5 deletions(-) diff --git a/src/browser.ts b/src/browser.ts index e65a634b08..709598e893 100644 --- a/src/browser.ts +++ b/src/browser.ts @@ -148,7 +148,6 @@ interface McpLaunchOptions { } export async function launch(options: McpLaunchOptions): Promise { - console.log('🔥', options); const {channel, executablePath, headless, isolated} = options; const profileDirName = channel && channel !== 'stable' @@ -175,8 +174,6 @@ export async function launch(options: McpLaunchOptions): Promise { const ignoreDefaultArgs: LaunchOptions['ignoreDefaultArgs'] = options.ignoreDefaultChromeArgs ?? false; - console.log(ignoreDefaultArgs); - if (headless) { args.push('--screen-info={3840x2160}'); } diff --git a/tests/cli.test.ts b/tests/cli.test.ts index 7ef8fddc8a..c5f966cf73 100644 --- a/tests/cli.test.ts +++ b/tests/cli.test.ts @@ -132,7 +132,6 @@ describe('cli args parsing', () => { `--chrome-arg='--no-sandbox'`, `--chrome-arg='--disable-setuid-sandbox'`, ]); - console.log('assert log -> ', args); assert.deepStrictEqual(args, { ...defaultArgs, _: [], @@ -151,7 +150,6 @@ describe('cli args parsing', () => { `--ignore-default-chrome-arg='--disable-extensions'`, `--ignore-default-chrome-arg='--disable-cancel-all-touches'`, ]); - console.log('assert log -> ', args); assert.deepStrictEqual(args, { ...defaultArgs, _: [], From 9d4a7b91297bc38ea094cbcd851eb25303905dc2 Mon Sep 17 00:00:00 2001 From: 0xluckycoder Date: Mon, 12 Jan 2026 15:08:43 +0530 Subject: [PATCH 6/7] fix arg typo --- src/browser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser.ts b/src/browser.ts index 709598e893..628007f6b7 100644 --- a/src/browser.ts +++ b/src/browser.ts @@ -169,7 +169,7 @@ export async function launch(options: McpLaunchOptions): Promise { const args: LaunchOptions['args'] = [ ...(options.chromeArgs ?? []), - '--hide-crash-resore-bubble', + '--hide-crash-restore-bubble', ]; const ignoreDefaultArgs: LaunchOptions['ignoreDefaultArgs'] = options.ignoreDefaultChromeArgs ?? false; From aff4e0fc3b07755dfaebb9c98673bee61355d26d Mon Sep 17 00:00:00 2001 From: 0xluckycoder Date: Mon, 12 Jan 2026 15:10:28 +0530 Subject: [PATCH 7/7] update docs --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 437233389f..1590f5c8cd 100644 --- a/README.md +++ b/README.md @@ -428,6 +428,10 @@ The Chrome DevTools MCP server supports the following configuration option: Additional arguments for Chrome. Only applies when Chrome is launched by chrome-devtools-mcp. - **Type:** array +- **`--ignoreDefaultChromeArg`/ `--ignore-default-chrome-arg`** + Explicitly disable default arguments for Chrome. Only applies when Chrome is launched by chrome-devtools-mcp. + - **Type:** array + - **`--categoryEmulation`/ `--category-emulation`** Set to false to exclude tools related to emulation. - **Type:** boolean