browser_evaluate
Run JavaScript in a page and return the JSON-serialisable result. Pass a function like () => document.title, or include a ref to pass an element as the first argument.
Instructions
Run JavaScript in the page and return the JSON-serialisable result. Pass a function: () => document.title, or (element) => element.value together with a ref. Promises are awaited.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Element passed as the function's first argument | |
| element | No | Human-readable element description used to obtain permission to interact with the element | |
| function | Yes | JavaScript function source, e.g. `() => location.href` |