执行 JavaScript
page_evaluateRun JavaScript in the current page context and return the result, including awaited Promises. Use it to inspect state, test expressions, or automate browser console tasks.
Instructions
在当前页面上下文执行一段 JavaScript 并返回结果(支持 await Promise),等价于 DevTools Console。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expression | Yes | 要执行的 JS 表达式或语句 | |
| awaitPromise | No | 是否等待返回的 Promise,默认 true | |
| returnByValue | No | 是否按值返回,默认 true |