Handle JavaScript dialog
browser_handle_dialogAccept or dismiss the JavaScript dialog that is pending on the shared tab. action is accept or dismiss. promptText (max 2000 characters) is sent only when accepting a prompt; on alert or confirm it is ignored and the result includes a warning. With no pending dialog the call returns NO_DIALOG. Two calls at once: the first resolves the dialog and the other returns NO_DIALOG. If nothing resolves the dialog within 30s it is dismissed and History records Dismissed a dialog (timeout). Uses Page.javascriptDialogOpening and Page.handleJavaScriptDialog. Does not click, type, or capture 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": {
"sessionId": "<sessionId>"
},
"name": "browser_handle_dialog"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | ||
| sessionId | Yes | ||
| promptText | No |