ChromeDevTools / ChromeDevTools/chrome-devtools-mcp
list_network_requests misses navigation requests in tabs opened via window.open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 52.3k
- Forks
- 4.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 83
Description
Is your feature request related to a problem? Please describe.
Description of the feature
When a page opens a new tab itself (window.open / target=_blank from a click handler), list_network_requests on that tab returns nothing — the entire navigation, redirect chain included, is missed. includePreservedRequests: true doesn't help; nothing was ever recorded. Quiet failure: an empty listing reads as "this tab made no requests".
Cause: new targets are wired reactively (McpContext.ts — targetcreated → await target.page() → void #createMcpPage(page)), so the popup navigates before the collector's Network.enable lands. And unlike console messages (#2382), Chromium doesn't replay network events to late CDP sessions, so there's nothing to backfill.
Reproduction
-
new_page→data:text/html,<a href="#" onclick="window.open('https://httpbingo.org/redirect-to?url=https%253A%252F%252Fexample.com%252F','_blank');return false;">OPEN</a> -
take_snapshot,clickthe link -
list_pages→ the popup is there, already landed onhttps://example.com/(redirect chain completed) -
select_pagethe popup,list_network_requestswithincludePreservedRequests: true→ empty
Sanity check: navigate that same popup anywhere afterwards and the request shows up fine — capture works, it just started too late.
Describe the solution you'd like
Expectation
Requests in opened tabs are captured from the first request. Since CDP offers no replay for Network events, the reliable shape seems to be pausing new targets until the collector is wired: Target.setAutoAttach with waitForDebuggerOnStart: true, enable Network on attach, then Runtime.runIfWaitingForDebugger.
Proposal
The proposed solution is to hold old new targets until the collector is wired: browser-level Target.setAutoAttach with waitForDebuggerOnStart: true, enable Network on attach, then Runtime.runIfWaitingForDebugger. The pause is a few milliseconds per new tab.
Enabling it could work like this:
- a server flag, e.g. --captureNewTabs, enabling pause-and-wire globally; or
- a runtime tool to arm it on demand
Describe alternatives you've considered
includePreservedRequests— doesn't apply: it preserves already-captured requests across navigations, and here nothing was ever captured.--chromeArg=--auto-open-devtools-for-tabs— verified, no effect: the held first navigation feeds the DevTools frontend's own CDP session, not the server's.- External sidecar: a second CDP client that arms
setAutoAttachitself and logs Network events (our current workaround), but lives outside the server and its capture is invisible to list_network_requests, so results come from two sources.
Additional context
Context: we run browser-ground-truth tests, where verifying click → redirect chain → landing is the whole point. The chain start is exactly the part that's lost.
Chrome DevTools MCP version
1.6.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in McpContext.ts at the targetcreated handler and follow await target.page() into #createMcpPage and network collector setup. Review the proposed Target.setAutoAttach, waitForDebuggerOnStart, Network.enable, and Runtime.runIfWaitingForDebugger flow. Done means list_network_requests captures the popup's initial request and redirect chain, including when the tab opens via window.open or target=_blank.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- devtools, networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100