handleJavaScriptDialog method

Future<void> handleJavaScriptDialog(
  1. bool accept, {
  2. String? promptText,
})

Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload). accept Whether to accept or dismiss the dialog. promptText The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog.

Implementation

Future<void> handleJavaScriptDialog(bool accept, {String? promptText}) async {
  await _client.send('Page.handleJavaScriptDialog', {
    'accept': accept,
    if (promptText != null) 'promptText': promptText,
  });
}