Handle Browser Dialog
browser_handle_dialogAuto-accept or dismiss JavaScript alert, confirm, and prompt dialogs. Call before actions that open dialogs, and provide prompt text to enter before accepting.
Instructions
Handle JavaScript alert(), confirm(), and prompt() dialogs. Call this BEFORE triggering an action that shows a dialog (e.g. before clicking a delete button that shows a confirm). The handler will auto-accept or auto-dismiss the next dialog that appears. For prompt() dialogs, provide promptText to enter text before accepting. If a dialog is already showing, it will be handled immediately.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Force a specific mode. | |
| action | Yes | Accept or dismiss the dialog | |
| sessionId | No | Puppeteer session ID. Skips mode selection. | |
| promptText | No | Text to enter if the dialog is a prompt() |