Handle JavaScript dialog
handle_dialogResolve blocking JavaScript alert, confirm, or prompt dialogs by accepting or dismissing them, and optionally entering text for prompt dialogs.
Instructions
Answer an open JavaScript dialog — alert, confirm or prompt.
A dialog blocks the page and every subsequent tool call until it is handled, so call this as soon as one appears. Returns an error if no dialog is open.
beforeunload dialogs triggered by navigating away are handled automatically
via navigate_page's handle_before_unload parameter; this tool is for
dialogs the page opens by itself.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | Accept (OK) or dismiss (Cancel) the dialog. Either closes an alert(); for confirm() the choice is what the page's JavaScript receives. | accept |
| browser | No | Which browser to act on. Each name is an independent Chrome, created on first use. Omit for the shared default; parallel agents each need their own name. | default |
| prompt_text | No | Text to enter into a prompt() dialog before accepting it. Ignored for alert() and confirm() dialogs. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |