Subscribe to CDP events: client.on('Network.requestWillBeSent', (event) => console.log(event.request.url))
Detach the session when done: await client.detach()
Known gotchas
CDP domains must be explicitly enabled (e.g. Network.enable, Runtime.enable) before sending commands or subscribing to events in that domain; omitting the enable call results in silent failures
CDPSession targets are tied to a specific page target; if the page navigates to a cross-origin frame, you need a separate CDPSession for the frame target to inspect it
CDP is a Chromium-only protocol; Puppeteer's WebDriver BiDi backend does not support createCDPSession, so ensure you are using a Chromium-backed browser instance
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp