Skip to content

fix: detect scheduled script navigations - #2622

Open
Elioooon wants to merge 1 commit into
ChromeDevTools:mainfrom
Elioooon:fix/script-navigation-flake
Open

fix: detect scheduled script navigations#2622
Elioooon wants to merge 1 commit into
ChromeDevTools:mainfrom
Elioooon:fix/script-navigation-flake

Conversation

@Elioooon

Copy link
Copy Markdown

Summary

  • listen for Page.frameScheduledNavigation in addition to Page.frameStartedNavigating while waiting for tool-triggered navigations
  • resolve the navigation probe as soon as the main frame schedules a document navigation, so evaluate_script does not miss script-initiated navigations on slower platforms
  • keep the existing wait window, same-document filtering for started navigations, and response shape unchanged

Fixes #2609

Validation

  • npm run format
  • npm run check-format
  • npm run test tests/tools/script.test.ts
  • npm run test tests/utils/WaitForHelper.test.ts
  • npm run test was also run. It failed in unrelated local environment/browser cases:
    • extension uninstall timeouts in extension/service-worker/list_pages/evaluate_script extension tests
    • browser_take_screenshot > with full page resulting in a large screenshot: Protocol error (Page.captureScreenshot): Page is too large

Risk

This only changes the early navigation-detection signal used by WaitForHelper. It does not change navigation timeout values, stable DOM waiting, dialog handling, iframe filtering, or the final navigatedToUrl response construction. --browserUrl and browser launch behavior are untouched.

@google-cla

google-cla Bot commented Aug 26, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@OrKoN

OrKoN commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

@Elioooon could you please sign the CLA?

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.

"still awaits a navigation when waitForStableDom is false" is flaky

2 participants