Evaluate JS in a renderer
evaluateRun JavaScript expressions in an Electron renderer's main world to inspect DOM, read state, and automate tasks beyond basic click/type actions.
Instructions
Run expression in the target renderer's main JS world via CDP Runtime.evaluate and return the result by value. Equivalent to typing the expression in the renderer's DevTools console. Use this for DOM inspection (document.title), state reads (localStorage.getItem('theme')), and any automation beyond what the click/type convenience tools cover.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Session id. | |
| target | No | Target id from `list_windows`. Default: first page. | |
| expression | Yes | JavaScript expression to evaluate. Wrap statements in an IIFE: `(() => { ... })()`. | |
| awaitPromise | No | Await the promise result (default true). | |
| returnByValue | No | Return the value by JSON-serialising it (default true). |