Skip to content

feat: let evaluate_script skip stable DOM wait#2344

Closed
mturac wants to merge 4 commits into
ChromeDevTools:mainfrom
mturac:izon/evaluate-script-stable-dom-option
Closed

feat: let evaluate_script skip stable DOM wait#2344
mturac wants to merge 4 commits into
ChromeDevTools:mainfrom
mturac:izon/evaluate-script-stable-dom-option

Conversation

@mturac

@mturac mturac commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a waitForStableDom option to evaluate_script so read-only scripts can skip the stable DOM wait
  • keep navigation and dialog handling on the existing post-action wait path
  • update the generated tool reference

Fixes #2338

Testing

  • npm run typecheck
  • npm run test -- tests/tools/script.test.ts
  • npm run check-format
  • git diff --check

@thomasbachem

Copy link
Copy Markdown
Contributor

Heads-up: npm run gen also regenerates src/telemetry/tool_call_metrics.json and src/bin/chrome-devtools-cli-options.ts for the new param – as-is check-docs will fail.

@mturac

mturac commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the heads-up. I re-ran the generation path on the current head 4e790e92a834 and confirmed the generated docs, CLI options, and metrics files are up to date.

Validation:

npm run gen
git diff --exit-code docs/tool-reference.md src/bin/chrome-devtools-cli-options.ts src/telemetry/tool_call_metrics.json
npm run check-format
npm run test:no-build -- tests/tools/script.test.ts

All pass locally.

@Lightning00Blade

Copy link
Copy Markdown
Collaborator

Thanks for the PR.
The PR's #2346 has 1 more test and the test is a little bit better as It verifies that the underlying wait code is not called.

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.

Allow read-only evaluate_script calls to skip the stable DOM wait

3 participants