browser_evaluate
Run custom JavaScript on the page or a selected element to inspect or manipulate the DOM, extract data, or verify behavior. Results can be saved to a file or returned as text.
Instructions
Evaluate JavaScript expression on page or element
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No | Exact target element reference from the page snapshot, or a unique element selector | |
| element | No | Human-readable element description used to obtain permission to interact with the element | |
| filename | No | File name to save the result to. Relative file names are resolved against the workspace root. If not provided, result is returned as text. | |
| function | Yes | () => { /* code */ } or (element) => { /* code */ } when element is provided |