browser_handle_dialog
Automate browser dialogs by pre-arming acceptance, dismissal, or text input before the next alert, confirm, or prompt appears, preventing click blockage. Optionally wait for an opening dialog.
Instructions
Arm automatic handling of the next JavaScript alert/confirm/prompt on the active tab, then return immediately. Call this BEFORE the click that opens the dialog — a dialog freezes the tab, so nothing can be clicked once it is on screen. Pass wait=true only when the dialog is already opening.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Text to enter for prompt() dialogs | |
| wait | No | Block until a dialog appears instead of arming and returning (default: false). Only use when the dialog is already on its way. | |
| action | No | Accept or dismiss the dialog (default: accept) | |
| timeout | No | How long the arming stays active in ms (default: 60000) |