ie_js
Runs JavaScript in an Internet Explorer page or frame and returns the result, enabling scripted inspection and control of legacy IE-only web applications.
Instructions
Execute JavaScript in the page or a frame and return the result. Over COM (target hwnd:/tab:) the script runs as a function body in the frame's own window: write ES3 (no JSON, let, arrow functions), return a primitive or an array (arrays come back joined with the character U+001E); a script error is reported, never sent to the page's onerror.
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": {
"script": "<script>"
},
"name": "ie_js"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| frame | No | ||
| limit | No | ||
| script | Yes | ||
| target | No | Where to act: omit it for the session's IE driver; hwnd:<n> acts over COM on the window <n> (a modal dialog's hwnd from a NOTICE or ie_windows), tab:<n> on an attached tab. Over COM, DOM access is script, input is synthetic (script events and a timer click, not mouse or keyboard input; keys are posted window messages) and only id, name, tag, class, link_text and (documentMode 8+) css locators work. |