Skip to content

fix: report page loads that keep the URL - #3395

Merged
OrKoN merged 2 commits into
ChromeDevTools:mainfrom
thomasbachem:fix/navigation-document-loads
Nov 11, 2026
Merged

OrKoN merged 2 commits into
ChromeDevTools:mainfrom
thomasbachem:fix/navigation-document-loads

Conversation

@thomasbachem

@thomasbachem thomasbachem commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Part of #3394

WaitForHelper decides whether an action navigated by comparing the page URL before and after it. So a load that ends on the same URL, like a reload or a form POST that redirects back, isn't reported at all.

This now also tracks whether the main frame loaded a new document during the action: CDP reports each one with Page.frameNavigated, while same-document navigations come as Page.navigatedWithinDocument. A new document then gets the existing Page navigated to <url>. line and structuredContent.navigatedToUrl even when its URL didn't change, in every tool that reports navigations: click, click_at, drag, fill, fill_form, hover, press_key, type_text and evaluate_script.

I checked the tracking against whether performance.timeOrigin changed in headless Chrome 156, and it matched in all 15 cases I tried, among them a form POST redirecting back to the same URL, a cross-origin navigation, one committing after the 100 ms window and back/forward cache restores.

The new test covers a reload that keeps the URL and fails on main. Another one, a replaceState that keeps the URL, passes on main too but fails if same-document navigations count as new documents. npm run test passes locally (macOS, Node 26, Chrome 156), and so does the suite after npm run bundle.

PageCollector still pairs FrameNavigatedWithinDocument with framenavigated in two places, so I'm happy to move both, and the tracking here, onto the events from puppeteer/puppeteer#15759 once they land. How same-document navigations are reported moved to #3410, which builds on this. #3226 also touches WaitForHelper.ts, so I can rebase on it if it lands first.

@samiyac samiyac 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 for the PR!

IIUC, this addresses two different issues, hence I would request you to separate them into 2 PRs. The changes for how same-document navigations are reported can be in a different PR.

@thomasbachem
thomasbachem force-pushed the fix/navigation-document-loads branch from b5a8aab to 5eebcc0 Compare November 4, 2026 15:34
@thomasbachem thomasbachem changed the title fix: distinguish same-document navigations from page loads fix: report page loads that keep the URL Nov 4, 2026
@thomasbachem

Copy link
Copy Markdown
Contributor Author

Sure, done. This one now only covers loads that keep the URL, and #3410 changes how same-document navigations read. It builds on this one, as both need the document tracking added here.

@samiyac samiyac 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.

Thank you!

@samiyac
samiyac enabled auto-merge November 9, 2026 18:57
auto-merge was automatically disabled November 10, 2026 14:45

Head branch was pushed to by a user without write access

Comment thread src/utils/WaitForHelper.ts Resolved
@OrKoN
OrKoN enabled auto-merge November 10, 2026 21:08
@thomasbachem

Copy link
Copy Markdown
Contributor Author

@OrKoN thanks! The one red job is the LogpointManager test "resolves original sources and re-binds after a rebuilt bundle" on Node 24, which this PR doesn't touch and which also failed in 16 jobs on other PRs since Nov 6, the release PR among them. Could you re-run it?

@OrKoN
OrKoN added this pull request to the merge queue Nov 11, 2026
Merged via the queue into ChromeDevTools:main with commit 3cc38bb Nov 11, 2026
19 of 21 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 &lt;select&gt;
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 <[email protected]>
@thomasbachem
thomasbachem deleted the fix/navigation-document-loads branch November 11, 2026 13:55
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.

3 participants