Evaluate JavaScript
browser_evaluateExecute custom JavaScript in the live browser page. Pass an arrow function as a string to read data or modify the page; optionally target an element to receive it as an argument.
Instructions
Run JavaScript in the page. Pass an arrow function as a string: "() => document.title". With target, the function receives the element.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No | Element ref or CSS selector to pass to the function | |
| filename | No | Save the result to this file instead of returning it | |
| function | Yes | () => { /* code */ } or (el) => { /* code */ } when target is given |