browser_handle_dialog
Answer JavaScript dialogs (alert, confirm, prompt, or leave-site) on the active tab. Arm automatic handling before a click that opens one, or answer an existing dialog now.
Instructions
Answer a JavaScript alert/confirm/prompt or "Leave site?" on the active tab. If a dialog this extension saw open is on screen and nobody is answering it, it is answered now, and the reply says what Chrome reports happened (action accept or dismiss). Otherwise this arms automatic handling of the next dialog on the tab and returns immediately - call it BEFORE the click that opens the dialog, because a dialog freezes the tab. Pass wait=true only when the dialog is already opening. Errors: dialog-being-answered (browser_navigate or an earlier call is answering it - wait), dialog-unconfirmed (answered, but Chrome did not confirm it closed), tab-not-responding (a dialog that opened before anything listened, or a busy page; the note says what to do).
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) |