Skip to content

fix: warn evaluate_script not to navigate page because navigation destroys execution context#2253

Closed
AhmerYarnham wants to merge 1 commit into
ChromeDevTools:mainfrom
AhmerYarnham:fix/evaluate-script-navigation-warning
Closed

fix: warn evaluate_script not to navigate page because navigation destroys execution context#2253
AhmerYarnham wants to merge 1 commit into
ChromeDevTools:mainfrom
AhmerYarnham:fix/evaluate-script-navigation-warning

Conversation

@AhmerYarnham

Copy link
Copy Markdown

Fixes #1894

Changes

  • Added warning in evaluate_script tool description that navigation
    (window.location.href) destroys execution context
  • Updated CLI help text
  • Updated tool-reference.md docs
  • Added regression test coverage

How to test

Run: npm run test:no-build -- tests/tools/script.test.ts

@google-cla

google-cla Bot commented Jun 24, 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.

@Lightning00Blade

Copy link
Copy Markdown
Collaborator

Thanks for the PR, but the real issue here is testing the new error, because of that we would prefer the team handle issues labeled with evals.

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.

The agent attempts to use window.location.href inside evaluate_script to scrape multiple pages in one go, which kills the execution context.

2 participants