dialogs
Get and manage native browser dialogs (alert, confirm, prompt, beforeunload) raised by a page. Set a policy to accept or dismiss future dialogs, preventing renderer blocks and timeouts.
Instructions
Native dialogs (alert/confirm/prompt/beforeunload) the page raised, and how they were answered (requires --enable-observers). With observers on, dialogs are intercepted rather than left to block the renderer - which is what otherwise turns a click that opens a confirm() into a mystery TIMEOUT. Set policy:'accept' to answer confirms with true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clear | No | ||
| limit | No | ||
| tabId | No | Target tab id (defaults to the active tab) | |
| policy | No | How to answer future dialogs (default dismiss: confirm->false, prompt->null) | |
| frameId | No | Act inside this frame (ids come from frames_list) | |
| sinceSeq | No | ||
| allFrames | No | Search every frame of the tab and act on the first that matches - use when a selector should match but does not (the element is in an iframe) | |
| promptText | No | Text to answer prompt() with when policy is 'accept' |