Skip to content

Commit a10c06a

Browse files
authored
Merge branch 'ChromeDevTools:main' into resize_bug_465
2 parents 96e9b45 + 14ff400 commit a10c06a

11 files changed

Lines changed: 114 additions & 33 deletions

File tree

.github/workflows/convetional-commit.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: 'Conventional Commit'
22

33
on:
4+
merge_group:
45
pull_request_target:
56
types:
67
# Defaults
@@ -19,6 +20,7 @@ jobs:
1920
permissions:
2021
pull-requests: read
2122
steps:
22-
- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
23+
- if: github.event_name != 'merge_group'
24+
uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
2325
env:
2426
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/presubmit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Check code before submitting
33
permissions: read-all
44

55
on:
6+
merge_group:
67
push:
78
branches:
89
- main

.github/workflows/run-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Compile and run tests
33
permissions: read-all
44

55
on:
6+
merge_group:
67
push:
78
branches:
89
- main

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Chrome DevTools MCP will not start the browser instance automatically using this
9191

9292
<details>
9393
<summary>Claude Code</summary>
94-
Use the Claude Code CLI to add the Chrome DevTools MCP server (<a href="https://docs.anthropic.com/en/docs/claude-code/mcp">guide</a>):
94+
Use the Claude Code CLI to add the Chrome DevTools MCP server (<a href="https://code.claude.com/docs/en/mcp">guide</a>):
9595

9696
```bash
9797
claude mcp add chrome-devtools npx chrome-devtools-mcp@latest
@@ -428,6 +428,10 @@ The Chrome DevTools MCP server supports the following configuration option:
428428
Additional arguments for Chrome. Only applies when Chrome is launched by chrome-devtools-mcp.
429429
- **Type:** array
430430

431+
- **`--ignoreDefaultChromeArg`/ `--ignore-default-chrome-arg`**
432+
Explicitly disable default arguments for Chrome. Only applies when Chrome is launched by chrome-devtools-mcp.
433+
- **Type:** array
434+
431435
- **`--categoryEmulation`/ `--category-emulation`**
432436
Set to false to exclude tools related to emulation.
433437
- **Type:** boolean

package-lock.json

Lines changed: 55 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"eslint-plugin-import": "^2.32.0",
6262
"globals": "^17.0.0",
6363
"prettier": "^3.6.2",
64-
"puppeteer": "24.34.0",
64+
"puppeteer": "24.35.0",
6565
"rollup": "4.55.1",
6666
"rollup-plugin-cleanup": "^3.2.1",
6767
"rollup-plugin-license": "^3.6.0",

src/browser.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ interface McpLaunchOptions {
142142
width: number;
143143
height: number;
144144
};
145-
args?: string[];
145+
chromeArgs?: string[];
146+
ignoreDefaultChromeArgs?: string[];
146147
devtools: boolean;
147148
}
148149

@@ -167,9 +168,12 @@ export async function launch(options: McpLaunchOptions): Promise<Browser> {
167168
}
168169

169170
const args: LaunchOptions['args'] = [
170-
...(options.args ?? []),
171+
...(options.chromeArgs ?? []),
171172
'--hide-crash-restore-bubble',
172173
];
174+
const ignoreDefaultArgs: LaunchOptions['ignoreDefaultArgs'] =
175+
options.ignoreDefaultChromeArgs ?? false;
176+
173177
if (headless) {
174178
args.push('--screen-info={3840x2160}');
175179
}
@@ -194,6 +198,7 @@ export async function launch(options: McpLaunchOptions): Promise<Browser> {
194198
pipe: true,
195199
headless,
196200
args,
201+
ignoreDefaultArgs: ignoreDefaultArgs,
197202
acceptInsecureCerts: options.acceptInsecureCerts,
198203
handleDevToolsAsPage: true,
199204
});

src/cli.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ export const cliOptions = {
168168
describe:
169169
'Additional arguments for Chrome. Only applies when Chrome is launched by chrome-devtools-mcp.',
170170
},
171+
ignoreDefaultChromeArg: {
172+
type: 'array',
173+
describe:
174+
'Explicitly disable default arguments for Chrome. Only applies when Chrome is launched by chrome-devtools-mcp.',
175+
},
171176
categoryEmulation: {
172177
type: 'boolean',
173178
default: true,
@@ -229,6 +234,10 @@ export function parseArguments(version: string, argv = process.argv) {
229234
`$0 --chrome-arg='--no-sandbox' --chrome-arg='--disable-setuid-sandbox'`,
230235
'Launch Chrome without sandboxes. Use with caution.',
231236
],
237+
[
238+
`$0 --ignore-default-chrome-arg='--disable-extensions'`,
239+
'Disable the default arguments provided by Puppeteer. Use with caution.',
240+
],
232241
['$0 --no-category-emulation', 'Disable tools in the emulation category'],
233242
[
234243
'$0 --no-category-performance',

src/main.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,12 @@ server.server.setRequestHandler(SetLevelRequestSchema, () => {
5454

5555
let context: McpContext;
5656
async function getContext(): Promise<McpContext> {
57-
const extraArgs: string[] = (args.chromeArg ?? []).map(String);
57+
const chromeArgs: string[] = (args.chromeArg ?? []).map(String);
58+
const ignoreDefaultChromeArgs: string[] = (
59+
args.ignoreDefaultChromeArg ?? []
60+
).map(String);
5861
if (args.proxyServer) {
59-
extraArgs.push(`--proxy-server=${args.proxyServer}`);
62+
chromeArgs.push(`--proxy-server=${args.proxyServer}`);
6063
}
6164
const devtools = args.experimentalDevtools ?? false;
6265
const browser =
@@ -78,7 +81,8 @@ async function getContext(): Promise<McpContext> {
7881
userDataDir: args.userDataDir,
7982
logFile,
8083
viewport: args.viewport,
81-
args: extraArgs,
84+
chromeArgs,
85+
ignoreDefaultChromeArgs,
8286
acceptInsecureCerts: args.acceptInsecureCerts,
8387
devtools,
8488
});

tests/browser.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ describe('browser', () => {
8282
userDataDir: folderPath,
8383
executablePath: executablePath(),
8484
devtools: false,
85-
args: ['--remote-debugging-port=0'],
85+
chromeArgs: ['--remote-debugging-port=0'],
8686
});
8787
try {
8888
const connectedBrowser = await ensureBrowserConnected({

0 commit comments

Comments
 (0)