Skip to content

fix(network): start an empty request list for navigations without a request - #3357

Merged
wolfib merged 2 commits into
ChromeDevTools:mainfrom
zerotohero3:fix/network-requests-after-requestless-navigation
Oct 28, 2026
Merged

wolfib merged 2 commits into
ChromeDevTools:mainfrom
zerotohero3:fix/network-requests-after-requestless-navigation

Conversation

@zerotohero3

Copy link
Copy Markdown
Contributor

Fixes #3356

When the main frame navigates, NetworkCollector.splitAfterNavigation() starts the new bucket at the last navigation request it finds. If the navigation didn't send a request (back/forward cache restore, about:blank), the last one it finds is the request that started the previous navigation, so the previous page's requests get moved into the current bucket and list_network_requests shows them as if they belonged to the current page.

The collector now remembers the navigation request that started the latest navigation and skips it when looking for the next one. If there's no new navigation request, the new bucket starts empty. It only keeps a reference to that one request and drops it on a navigation without a request.

What changes for users: after a navigation that doesn't send a request, list_network_requests shows only the requests made since then (usually none) instead of the previous page's. The previous page's requests are still listed with includePreservedRequests. Navigations that do send a request work the same as before, including back/forward without the cache, reloads and redirects.

Testing:

  • Added a test for a navigation without a request. It fails on main (the previous navigation's requests come back) and passes with the fix.
  • npm run test passes locally (Linux, Node 24, Chrome 156).
  • Ran the repro from the issue against a real Chrome: after back (restored from the cache) and after about:blank, the list is empty. With --disable-features=BackForwardCache, back and forward list the requests of the page they load, same as before.

…equest

When a main-frame navigation sent no request, such as a back/forward
cache restore or about:blank, splitAfterNavigation() found the request
of the previous navigation and moved the previous page's requests into
the current navigation.

@OKAN-SOFTWARE OKAN-SOFTWARE left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changes in PR #3357.

The fix addresses the reported issue by tracking the navigation request associated with the latest navigation and preventing it from being reused during a subsequent navigation without a network request.

The existing navigation and redirect behavior appears consistent with the updated implementation.

Non-blocking test coverage suggestion:

Consider adding regression assertions for:

  • Preserving previous requests through getData(true) after a requestless navigation.
  • Processing a normal navigation following a requestless navigation.
  • Handling consecutive requestless navigations.

These would help protect the behavior during future changes to navigation history handling.

The author's local test results are reported as passing, but I have not independently rerun them. GitHub Actions currently reports action_required.

No blocking issue found within the reviewed scope.

Comment thread tests/collectors/PageCollector.test.ts Resolved

@wolfib wolfib left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

@wolfib
wolfib added this pull request to the merge queue Oct 28, 2026
Merged via the queue into ChromeDevTools:main with commit b701776 Oct 28, 2026
14 checks passed
Lightning00Blade pushed a commit to jaeminbird/chrome-devtools-mcp that referenced this pull request Nov 11, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.13.0](ChromeDevTools/chrome-devtools-mcp@chrome-devtools-mcp-v1.12.0...chrome-devtools-mcp-v1.13.0)
(2026-11-11)


### 🎉 Features

* add logpoints built on the DevTools BreakpointManager
([ChromeDevTools#3211](ChromeDevTools#3211))
([0877ee0](ChromeDevTools@0877ee0))
* add page-scoped network mocks
([ChromeDevTools#3384](ChromeDevTools#3384))
([1d692d3](ChromeDevTools@1d692d3))
* support upstream network mock responses
([ChromeDevTools#3420](ChromeDevTools#3420))
([c4bf342](ChromeDevTools@c4bf342))


### 🛠️ Fixes

* **config:** accept config files with a UTF-8 BOM
([ChromeDevTools#3365](ChromeDevTools#3365))
([63170b1](ChromeDevTools@63170b1))
* **console:** stop resolving a cyclic Error.cause chain after 10 causes
([ChromeDevTools#3338](ChromeDevTools#3338))
([172656a](ChromeDevTools@172656a))
* disable set_logpoints when --no-javascript-evaluation is set
([ChromeDevTools#3415](ChromeDevTools#3415))
([11fcc59](ChromeDevTools@11fcc59)),
closes
[ChromeDevTools#3414](ChromeDevTools#3414)
* **extensions:** say list_extensions only lists unpacked extensions
([ChromeDevTools#3433](ChromeDevTools#3433))
([1383bb9](ChromeDevTools@1383bb9))
* ignore an invalid cached version in the update check
([ChromeDevTools#3392](ChromeDevTools#3392))
([3a9f378](ChromeDevTools@3a9f378))
* **input:** validate press_key and submitKey parameters in Zod schema
([ChromeDevTools#3382](ChromeDevTools#3382))
([375a269](ChromeDevTools@375a269))
* **network:** start an empty request list for navigations without a
request
([ChromeDevTools#3357](ChromeDevTools#3357))
([b701776](ChromeDevTools@b701776))
* normalize non-Error values thrown by tool handlers
([ChromeDevTools#3068](ChromeDevTools#3068))
([535a3dc](ChromeDevTools@535a3dc))
* **performance:** error when performance_stop_trace is called on a
non-recording page
([ChromeDevTools#2971](ChromeDevTools#2971))
([ChromeDevTools#3117](ChromeDevTools#3117))
([1ab630a](ChromeDevTools@1ab630a))
* **plugin:** launch the Claude Code MCP server with npx --prefix
([ChromeDevTools#3353](ChromeDevTools#3353))
([a24334d](ChromeDevTools@a24334d))
* preserve task serialization on request cancellation
([ChromeDevTools#3079](ChromeDevTools#3079))
([03fd4e8](ChromeDevTools@03fd4e8))
* report page loads that keep the URL
([ChromeDevTools#3395](ChromeDevTools#3395))
([3cc38bb](ChromeDevTools@3cc38bb))
* save binary request bodies byte for byte
([ChromeDevTools#3404](ChromeDevTools#3404))
([e3eb901](ChromeDevTools@e3eb901))
* suggest --headless when Chrome cannot find an X server
([ChromeDevTools#3428](ChromeDevTools#3428))
([8b0856a](ChromeDevTools@8b0856a))
* **url:** unwrap view-source: before all scheme checks in validateUrl
([ChromeDevTools#3335](ChromeDevTools#3335))
([7275268](ChromeDevTools@7275268))
* **wait:** explain whitespace-sensitive text matching
([ChromeDevTools#3350](ChromeDevTools#3350))
([81a0379](ChromeDevTools@81a0379))


### 📄 Documentation

* add Pi client configuration
([ChromeDevTools#3364](ChromeDevTools#3364))
([bc0d93e](ChromeDevTools@bc0d93e))
* clarify custom browser launch and connection options
([ChromeDevTools#3386](ChromeDevTools#3386))
([7e10c08](ChromeDevTools@7e10c08))
* **input:** note that press_key cannot drive native <select>
popups on macOS
([ChromeDevTools#3288](ChromeDevTools#3288))
([8e79bd0](ChromeDevTools@8e79bd0))


### ⚡ Performance

* **memory:** drop async parents of request initiators in
NetworkCollector
([ChromeDevTools#3345](ChromeDevTools#3345))
([ca6f834](ChromeDevTools@ca6f834)),
closes
[ChromeDevTools#3344](ChromeDevTools#3344)


### 🏗️ Refactor

* re-export only used Zod runtime members from third_party barrel
([ChromeDevTools#3439](ChromeDevTools#3439))
([6b056c8](ChromeDevTools@6b056c8))
* reuse Zod schemas and validate integer viewport dimensions
([ChromeDevTools#3367](ChromeDevTools#3367))
([3c609da](ChromeDevTools@3c609da))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

list_network_requests shows the previous page's requests after going back or to about:blank

3 participants