handle_dialog
Set up a handler for JavaScript dialogs (alert, confirm, prompt) to accept or dismiss them before they block the page. Provide the session ID and action; optionally enter prompt text.
Instructions
Arm a one-shot handler for the NEXT JavaScript dialog (alert/confirm/prompt) on a session — accept or dismiss, with optional prompt text. Returns {success}. Must be called BEFORE the action that triggers the dialog, otherwise the dialog blocks the page and times out.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Accept or dismiss the dialog | |
| session_id | Yes | Session ID | |
| prompt_text | No | Text to enter for prompt() dialogs (optional) |