chrome_inject_script
Inject and manage JavaScript scripts in a DICloak browser page by environment ID, including inline code, script files, script tags, removal, and listing.
Instructions
Inject JavaScript scripts into the page
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": {
"envId": "<envId>",
"action": "<action>"
},
"name": "chrome_inject_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Script element ID (for add_script_tag) | |
| url | No | Script URL (required for add_script_tag) | |
| envId | Yes | Environment ID for the browser environment to operate. | |
| action | Yes | Action type: inject, inject_file, add_script_tag, remove_script, list_scripts | |
| script | No | JavaScript code (required for inject) | |
| content | No | Inline script content (for add_script_tag) | |
| file_path | No | Script file path (required for inject_file) | |
| element_id | No | Element ID to remove (for remove_script) |