eval_main
Execute JavaScript code in the Electron main process to access system resources, invoke IPC handlers, and control application windows beyond renderer limitations.
Instructions
Evaluate JavaScript in the Electron main process. Pass a FUNCTION BODY — use return to yield a value. The body receives electron (the full Electron module) and arg (your JSON-serializable payload). Supports async/await. Use this to invoke IPC handlers, read paths, or drive windows the renderer cannot reach.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| js | Yes | Function body. Use `return` to yield a value. `electron` and `arg` are available as locals. | |
| arg | No | Arbitrary JSON-serializable value exposed as `arg` inside the body. Objects, arrays, primitives, and null all work. |