Evaluate JavaScript in a page
evaluate_jsExecute JavaScript in an attached H5 page to inspect or change page state, read cookies/storage, and return results, including awaited Promises.
Instructions
Run a JavaScript expression in an attached page and return its result. Plain objects/arrays come back as JSON (so nested Map/Set/DOM values show as {}); other values (DOM nodes, Map, Set, Error, window) as a short description. Promises are awaited. For multiple statements or await, wrap them: (async () => { ... })(). Runs with the page's full privileges, so it can read cookies/storage and change page state.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target_id | No | Defaults to the most recently attached page | |
| expression | Yes | JavaScript expression to evaluate |