Page.handleJavaScriptDialogAccepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).
| Name | Type | Description |
|---|---|---|
accept | boolean | Whether to accept or dismiss the dialog. |
promptText (optional) | string | The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog. |
{
"id": 1,
"method": "Page.handleJavaScriptDialog",
"params": {
"accept": true
}
}
{
"id": 1,
"result": {}
}
const result = await send('Page.handleJavaScriptDialog', {"accept": true});
console.log(result);