chrome-devtools-mcp 0.20.1 → 0.20.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -156,6 +156,9 @@ Then, install the plugin:
156
156
 
157
157
  Restart Claude Code to have the MCP server and skills load (check with `/skills`).
158
158
 
159
+ > [!TIP]
160
+ > If the plugin installation fails with a `Failed to clone repository` error (e.g., HTTPS connectivity issues behind a corporate firewall), see the [troubleshooting guide](./docs/troubleshooting.md#claude-code-plugin-installation-fails-with-failed-to-clone-repository) for workarounds, or use the CLI installation method above instead.
161
+
159
162
  </details>
160
163
 
161
164
  <details>
@@ -7,7 +7,7 @@ import fs from 'node:fs/promises';
7
7
  import path from 'node:path';
8
8
  import { UniverseManager } from './DevtoolsUtils.js';
9
9
  import { McpPage } from './McpPage.js';
10
- import { NetworkCollector, ConsoleCollector } from './PageCollector.js';
10
+ import { NetworkCollector, ConsoleCollector, } from './PageCollector.js';
11
11
  import { Locator } from './third_party/index.js';
12
12
  import { PredefinedNetworkConditions } from './third_party/index.js';
13
13
  import { listPages } from './tools/pages.js';
@@ -472,10 +472,18 @@ export class McpContext {
472
472
  if (!mcpPage) {
473
473
  return;
474
474
  }
475
- if (await page.hasDevTools()) {
476
- mcpPage.devToolsPage = await page.openDevTools();
475
+ // Prior to Chrome 144.0.7559.59, the command fails,
476
+ // Some Electron apps still use older version
477
+ // Fall back to not exposing DevTools at all.
478
+ try {
479
+ if (await page.hasDevTools()) {
480
+ mcpPage.devToolsPage = await page.openDevTools();
481
+ }
482
+ else {
483
+ mcpPage.devToolsPage = undefined;
484
+ }
477
485
  }
478
- else {
486
+ catch {
479
487
  mcpPage.devToolsPage = undefined;
480
488
  }
481
489
  }));
@@ -28,7 +28,7 @@ export class PageCollector {
28
28
  #browser;
29
29
  #listenersInitializer;
30
30
  #listeners = new WeakMap();
31
- #maxNavigationSaved = 3;
31
+ maxNavigationSaved = 3;
32
32
  /**
33
33
  * This maps a Page to a list of navigations with a sub-list
34
34
  * of all collected resources.
@@ -109,7 +109,7 @@ export class PageCollector {
109
109
  }
110
110
  // Add the latest navigation first
111
111
  navigations.unshift([]);
112
- navigations.splice(this.#maxNavigationSaved);
112
+ navigations.splice(this.maxNavigationSaved);
113
113
  }
114
114
  cleanupPageDestroyed(page) {
115
115
  const listeners = this.#listeners.get(page);
@@ -129,7 +129,7 @@ export class PageCollector {
129
129
  return navigations[0];
130
130
  }
131
131
  const data = [];
132
- for (let index = this.#maxNavigationSaved; index >= 0; index--) {
132
+ for (let index = this.maxNavigationSaved; index >= 0; index--) {
133
133
  if (navigations[index]) {
134
134
  data.push(...navigations[index]);
135
135
  }
@@ -305,5 +305,6 @@ export class NetworkCollector extends PageCollector {
305
305
  else {
306
306
  navigations.unshift([]);
307
307
  }
308
+ navigations.splice(this.maxNavigationSaved);
308
309
  }
309
310
  }
@@ -8,7 +8,7 @@ export const cliOptions = {
8
8
  autoConnect: {
9
9
  type: 'boolean',
10
10
  description: 'If specified, automatically connects to a browser (Chrome 144+) running locally from the user data directory identified by the channel param (default channel is stable). Requires the remoted debugging server to be started in the Chrome instance via chrome://inspect/#remote-debugging.',
11
- conflicts: ['isolated', 'executablePath'],
11
+ conflicts: ['isolated', 'executablePath', 'categoryExtensions'],
12
12
  default: false,
13
13
  coerce: (value) => {
14
14
  if (!value) {
@@ -21,7 +21,7 @@ export const cliOptions = {
21
21
  type: 'string',
22
22
  description: 'Connect to a running, debuggable Chrome instance (e.g. `http://127.0.0.1:9222`). For more details see: https://github.com/ChromeDevTools/chrome-devtools-mcp#connecting-to-a-running-chrome-instance.',
23
23
  alias: 'u',
24
- conflicts: 'wsEndpoint',
24
+ conflicts: ['wsEndpoint', 'categoryExtensions'],
25
25
  coerce: (url) => {
26
26
  if (!url) {
27
27
  return;
@@ -39,7 +39,7 @@ export const cliOptions = {
39
39
  type: 'string',
40
40
  description: 'WebSocket endpoint to connect to a running Chrome instance (e.g., ws://127.0.0.1:9222/devtools/browser/<id>). Alternative to --browserUrl.',
41
41
  alias: 'w',
42
- conflicts: 'browserUrl',
42
+ conflicts: ['browserUrl', 'categoryExtensions'],
43
43
  coerce: (url) => {
44
44
  if (!url) {
45
45
  return;
@@ -193,9 +193,9 @@ export const cliOptions = {
193
193
  },
194
194
  categoryExtensions: {
195
195
  type: 'boolean',
196
- default: false,
197
196
  hidden: true,
198
- describe: 'Set to false to exclude tools related to extensions.',
197
+ conflicts: ['browserUrl', 'autoConnect', 'wsEndpoint'],
198
+ describe: 'Set to true to include tools related to extensions. Note: This feature is only supported with a pipe connection. autoConnect is not supported.',
199
199
  },
200
200
  performanceCrux: {
201
201
  type: 'boolean',
@@ -95,7 +95,7 @@ export async function createMcpServer(serverArgs, options) {
95
95
  return;
96
96
  }
97
97
  if (tool.annotations.category === ToolCategory.EXTENSIONS &&
98
- serverArgs.categoryExtensions === false) {
98
+ !serverArgs.categoryExtensions) {
99
99
  return;
100
100
  }
101
101
  if (tool.annotations.conditions?.includes('computerVision') &&
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "@modelcontextprotocol/sdk": "1.27.1",
3
- "chrome-devtools-frontend": "1.0.1596260",
3
+ "chrome-devtools-frontend": "1.0.1599001",
4
4
  "core-js": "3.48.0",
5
5
  "debug": "4.4.3",
6
6
  "lighthouse": "13.0.3",
@@ -3117,7 +3117,6 @@ var ExperimentName;
3117
3117
  ExperimentName["SHOW_OPTION_TO_EXPOSE_INTERNALS_IN_HEAP_SNAPSHOT"] = "show-option-to-expose-internals-in-heap-snapshot";
3118
3118
  ExperimentName["TIMELINE_INVALIDATION_TRACKING"] = "timeline-invalidation-tracking";
3119
3119
  ExperimentName["TIMELINE_SHOW_ALL_EVENTS"] = "timeline-show-all-events";
3120
- ExperimentName["TIMELINE_V8_RUNTIME_CALL_STATS"] = "timeline-v8-runtime-call-stats";
3121
3120
  ExperimentName["APCA"] = "apca";
3122
3121
  ExperimentName["FONT_EDITOR"] = "font-editor";
3123
3122
  ExperimentName["FULL_ACCESSIBILITY_TREE"] = "full-accessibility-tree";