content_script_eval
Execute JavaScript in a page's isolated or main world to debug and test Chrome extensions directly from AI coding agents.
Instructions
Execute JavaScript in the page context (ISOLATED or MAIN world).
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": {
"expression": "<expression>"
},
"name": "content_script_eval"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| world | No | Execution world. MAIN accesses page JS context, ISOLATED is sandboxed. | ISOLATED |
| expression | Yes | JavaScript expression to evaluate in the page |