Skip to content

Commit ed595e1

Browse files
committed
fix: allow --categoryExtensions when connecting to an existing browser
Remove the categoryExtensions conflicts with autoConnect, browserUrl and wsEndpoint added in #2753. Chrome 149+ supports extension debugging over these connections, and 1.10.1 accepts the combination. Update the --categoryExtensions help text, generated docs and the troubleshooting skill to state the Chrome 149+ requirement for attach modes. Fixes #2989
1 parent 3712dfd commit ed595e1

5 files changed

Lines changed: 21 additions & 46 deletions

File tree

‎docs/configuration.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The Chrome DevTools MCP server supports the following configuration option:
3535
- **Default:** `true`
3636

3737
- **`--categoryExtensions`/ `--category-extensions`**
38-
Set to true to include tools related to extensions. Note: This feature is currently only supported with a pipe connection. autoConnect, browserUrl, and wsEndpoint are not supported with this feature until 149 will be released.
38+
Set to true to include tools related to extensions. With autoConnect, browserUrl or wsEndpoint, this requires Chrome 149 or later.
3939
- **Type:** boolean
4040
- **Default:** `false`
4141

‎skills/troubleshooting/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ All tools in `chrome-devtools-mcp` are annotated with `readOnlyHint: true` (for
5252
If the tools related to extensions (like `install_extension`) are not available, or if the extensions you load are not functioning:
5353

5454
1. **Check for the `--categoryExtensions` flag**: Ensure this flag is passed in the MCP server configuration to enable the extension category tools.
55-
2. **Make sure the MCP server in configured to launch Chrome instead of connecting to an instance**: Chrome before 149 is not able to load extensions when connecting to an existing instance (`--auto-connect`, `--browserUrl`).
55+
2. **When connecting to an existing instance (`--auto-connect`, `--browserUrl`, `--wsEndpoint`), use Chrome 149 or later**: earlier versions are not able to load extensions over such a connection. Otherwise, configure the MCP server to launch Chrome.
5656

5757
#### Other Common Errors
5858

‎src/config/category-options.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const categoryOverrides: Record<
4343
},
4444
[ToolCategory.EXTENSIONS]: {
4545
describe:
46-
'Set to true to include tools related to extensions. Note: This feature is currently only supported with a pipe connection. autoConnect, browserUrl, and wsEndpoint are not supported with this feature until 149 will be released.',
46+
'Set to true to include tools related to extensions. With autoConnect, browserUrl or wsEndpoint, this requires Chrome 149 or later.',
4747
offByDefault: true,
4848
},
4949
[ToolCategory.THIRD_PARTY]: {

‎src/config/mcp-options.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,6 @@ export const CONFLICTING_ARGS: Array<Array<keyof typeof mcpOptions>> = [
339339
['allowUnrestrictedPaths', 'filesystemRoot'],
340340
['categoryPwa', 'autoConnect'],
341341
['categoryPwa', 'browserUrl', 'wsEndpoint'],
342-
['categoryExtensions', 'autoConnect'],
343-
['categoryExtensions', 'browserUrl', 'wsEndpoint'],
344342
];
345343

346344
export const IMPLICATIONS: Array<

‎tests/cli.test.ts‎

Lines changed: 18 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,36 +1164,16 @@ describe('cli args parsing', () => {
11641164
assert.strictEqual(args.executablePath, '/bin/chrome');
11651165
});
11661166

1167-
it('rejects categoryExtensions with autoConnect', async () => {
1168-
assert.throws(
1169-
() => parseConfig(['--category-extensions', '--auto-connect']),
1170-
/Arguments categoryExtensions and autoConnect are mutually exclusive/,
1171-
);
1172-
});
1173-
1174-
it('rejects categoryExtensions with browserUrl', async () => {
1175-
assert.throws(
1176-
() =>
1177-
parseConfig([
1178-
'--category-extensions',
1179-
'--browserUrl',
1180-
'http://localhost:9222',
1181-
]),
1182-
/Arguments categoryExtensions and browserUrl are mutually exclusive/,
1183-
);
1184-
});
1185-
1186-
it('rejects categoryExtensions with wsEndpoint', async () => {
1187-
assert.throws(
1188-
() =>
1189-
parseConfig([
1190-
'--category-extensions',
1191-
'--wsEndpoint',
1192-
'ws://localhost:9222',
1193-
]),
1194-
/Arguments categoryExtensions and wsEndpoint are mutually exclusive/,
1195-
);
1196-
});
1167+
for (const connectArgs of [
1168+
['--auto-connect'],
1169+
['--browserUrl', 'http://localhost:9222'],
1170+
['--wsEndpoint', 'ws://localhost:9222'],
1171+
]) {
1172+
it(`allows categoryExtensions with ${connectArgs[0]}`, async () => {
1173+
const args = parseConfig(['--category-extensions', ...connectArgs]);
1174+
assert.strictEqual(args.categoryExtensions, true);
1175+
});
1176+
}
11971177

11981178
for (const connectArgs of [
11991179
['--browserUrl', 'http://localhost:9222'],
@@ -1218,17 +1198,14 @@ describe('cli args parsing', () => {
12181198
});
12191199
}
12201200

1221-
it('rejects explicit categoryExtensions with browserUrl in viaCli', async () => {
1222-
assert.throws(
1223-
() =>
1224-
parseConfig([
1225-
'--viaCli',
1226-
'--category-extensions',
1227-
'--browserUrl',
1228-
'http://localhost:9222',
1229-
]),
1230-
/Arguments categoryExtensions and browserUrl are mutually exclusive/,
1231-
);
1201+
it('allows explicit categoryExtensions with browserUrl in viaCli', async () => {
1202+
const args = parseConfig([
1203+
'--viaCli',
1204+
'--category-extensions',
1205+
'--browserUrl',
1206+
'http://localhost:9222',
1207+
]);
1208+
assert.strictEqual(args.categoryExtensions, true);
12321209
});
12331210
});
12341211

0 commit comments

Comments
 (0)