chrome-devtools-mcp icon indicating copy to clipboard operation
chrome-devtools-mcp copied to clipboard

Make the number of retained navigations configurable (--maxNavigationSaved)

Open BumaldaOverTheWater94 opened this issue 1 month ago • 2 comments

Is your feature request related to a problem? Please describe.

Summary

Network requests and console messages are currently retained for a fixed number of navigations per page (maxNavigationSaved = 3). I'd like to make this configurable with a --maxNavigationSaved flag (default 3, so behavior is unchanged unless the flag is set) so agents can inspect multi-hop flows that go beyond three navigations.

PR with a proposed implementation: #3018

Motivation

Many real-world flows bounce the main frame through more than three documents before landing on the final page:

  • Sign-in flows that go through login → MFA/consent → post-login landing pages
  • OAuth / OIDC / SAML SSO, where the browser hops between the relying party, the identity provider (sometimes several, with federation), and back
  • Corporate networks, where proxies, captive portals, and device-compliance checks add hops before the destination

Many of these hops are full document navigations (JS redirects, auto-submitting forms, meta refresh), and each one uses up one of the 3 retained navigations. By the time the agent calls list_network_requests with includePreservedRequests: true, the earliest hops (often the ones that matter, such as the initial authorization request or the first Set-Cookie) have already been dropped. The agent can't reconstruct the full chain, and the only workaround is to re-run the flow and try to catch it mid-way.

With a configurable limit, users debugging these flows can opt in to a longer history.

What is retained for earlier navigations

Raising the limit keeps the request objects for earlier navigations: URL, method, status code, request and response headers (including Location and Set-Cookie), and the redirect chain. Response bodies of earlier documents are generally no longer available (the tool already reports <Response body not available anymore> in that case). That's sufficient for network analysis of redirect hops, which is the main use case here.

Describe the solution you'd like

Instead of hardcoding saved navigations, make it user-configurable.

Describe alternatives you've considered

Alternatives are to manually write a script to record navigations outside of the MCP. For example, start a websocket connection and log Network.requestWillBeSent() and responseReceived()

Additional context

No response

BumaldaOverTheWater94 avatar Oct 11 '26 01:10 BumaldaOverTheWater94

Thanks for the concrete SAML example; multi-hop sign-in flows are a good reason to keep more history. We'll consider making the number of retained navigations configurable, and the implementation is being reviewed in #3018.

natorion avatar Oct 14 '26 14:10 natorion

PR landed.

Lightning00Blade avatar Oct 21 '26 17:10 Lightning00Blade