Skip to content

Commit 8a355ef

Browse files
triuzziclaude
andauthored
fix: align DevTools host/network integration with upstream 1.2.0 mcp.js (#16)
Upstream chrome-devtools-mcp 1.2.0 reworked mcp.js: it exports Host and NetworkManager and no longer expects consumers to install host bindings themselves. The fork's overrideDevToolsGlobals() still ran the obsolete DevTools.Host.InspectorFrontendHost.installInspectorFrontendHost(...) call and carried a duplicate McpHostBindingAdapter (a stale copy of upstream's McpHostBindings that even missed the real loadNetworkResource). Against the 1.2.0 bundle these crash with "Cannot read properties of undefined (reading 'InspectorFrontendHost')". Drop the manual install and the duplicate adapter to match upstream 1.2.0, which installs nothing here and relies on mcp.js. The follow-on "NetworkManager undefined" error was a stale incremental build artifact, fixed by a clean rebuild. Co-authored-by: Claude <noreply@anthropic.com>
1 parent 556ec85 commit 8a355ef

2 files changed

Lines changed: 3 additions & 259 deletions

File tree

src/devtools/DevtoolsUtils.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import type {
1616
} from '../third_party/index.js';
1717

1818
import {PuppeteerDevToolsConnection} from './DevToolsConnectionAdapter.js';
19-
import {McpHostBindingAdapter} from './McpHostBindingAdapter.js';
2019

2120
/**
2221
* A mock implementation of an issues manager that only implements the methods
@@ -30,9 +29,9 @@ export class FakeIssuesManager extends DevTools.Common.ObjectWrapper
3029
}
3130

3231
export function overrideDevToolsGlobals(): void {
33-
DevTools.Host.InspectorFrontendHost.installInspectorFrontendHost(
34-
new McpHostBindingAdapter(),
35-
);
32+
// Host bindings are installed by upstream's mcp/mcp.js at import time
33+
// (installInspectorFrontendHost(new McpHostBindings())). Since v1.2.0 the
34+
// bundle self-installs them and no longer exports DevTools.Host for callers.
3635

3736
// DevTools CDP errors can get noisy.
3837
DevTools.ProtocolClient.InspectorBackend.test.suppressRequestErrors = true;

src/devtools/McpHostBindingAdapter.ts

Lines changed: 0 additions & 255 deletions
This file was deleted.

0 commit comments

Comments
 (0)