browser_run_code_unsafe
Execute raw Playwright JavaScript snippets against the active page and receive their JSON results, enabling custom automation when unsafe mode is enabled.
Instructions
DANGEROUS: run a raw Playwright JavaScript snippet (async function body with page in scope) against the active page and return its JSON result. Disabled unless LAYA_ALLOW_UNSAFE_CODE=true.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>"
},
"name": "browser_run_code_unsafe"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | A JavaScript snippet run as an async function body with the Playwright `page` in scope, e.g. 'return await page.title();'. |