ruyi_evaluate_script
Executes JavaScript functions in a browser page and returns JSON-safe results. Use for runtime sampling, hook injection, and reading page state.
Instructions
在浏览器页面中执行 JavaScript 函数并返回结果。可用于运行时采样、Hook 注入、读取页面状态。函数必须返回 JSON-safe 值。支持接收本地文件作为参数。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pageIdx | No | 标签页索引,默认当前活跃页 | |
| sandbox | No | BiDi sandbox 名称(隔离执行上下文) | |
| timeout | No | 超时(秒),默认 10 | |
| function | Yes | 要执行的 JavaScript 函数声明。例: "() => { return document.title }" 或 "async () => { return await fetch('example.com') }" |