js
Execute JavaScript in the current browser tab and receive the completion value. Handles top-level return statements and converts special values like Infinity, NaN, and BigInt to Python equivalents, while reporting page errors transparently.
Instructions
js("document.title") — 在页面执行 JS,返回完成值。tab 不传打当前活动标签。
先按裸表达式/脚本 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 |
|---|---|---|---|
| tab | No | ||
| code | Yes |