Auto-handle JS dialogs (alert/confirm/prompt)
dialogArm a tab to auto-handle and capture native JavaScript pop-ups so pages do not freeze or block the browser connection; retrieve captured pop-ups or stop handling when done.
Instructions
Native JS dialogs freeze the page and wedge the whole connection. Opt-in per tab: 'arm' (behavior 'dismiss' (default) or 'accept'; optional promptText for prompt()) makes future dialogs on that tab auto-handle + get captured; 'get' returns captured dialogs; 'disarm' stops. Arm BEFORE an action that may trigger a dialog. Default 'dismiss' never auto-confirms destructive dialogs.
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": {
"action": "<action>",
"tabId": "<tabId>"
},
"name": "dialog"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tabId | Yes | Target tab ID (must be in the MCP group) | |
| action | Yes | arm / disarm / get | |
| behavior | No | On arm: accept or dismiss (default dismiss) | |
| promptText | No | Text to submit for prompt() dialogs when accepting |