js
Execute JavaScript in the current browser page and retrieve the completion value, handling expressions, return statements, and non-serializable values while reporting errors accurately.
Instructions
js("document.title") — 在当前页面执行 JS,返回完成值。
先按裸表达式/脚本 eval(document.title 直接返回标题);顶层 return 触发
"Illegal return statement" 时自动包进函数重试(return x 也能用)。
不可 JSON 序列化的值(Infinity/NaN/-0/BigInt)解码回 Python 值,不再吐原始 dict。
页内异常 / eval 出错 → ok:false,不伪造成功。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes |