browser_add_preload_script
Inject custom JavaScript into every new document before page scripts load to add hooks or Tampermonkey-style behavior.
Instructions
Inject custom JavaScript to run on every new document before page scripts load (hooks / Tampermonkey).
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": {
"source": "<source>"
},
"name": "browser_add_preload_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | JavaScript source code to evaluate |