onJsConfirm property

  1. @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'WebChromeClient.onJsConfirm', apiUrl: 'https://developer.android.com/reference/android/webkit/WebChromeClient#onJsConfirm(android.webkit.WebView,%20java.lang.String,%20java.lang.String,%20android.webkit.JsResult)'), IOSPlatform(apiName: 'WKUIDelegate.webView', apiUrl: 'https://developer.apple.com/documentation/webkit/wkuidelegate/1536489-webview'), MacOSPlatform(apiName: 'WKUIDelegate.webView', apiUrl: 'https://developer.apple.com/documentation/webkit/wkuidelegate/1536489-webview'), LinuxPlatform(apiName: 'WebKitWebView::script-dialog', apiUrl: 'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/signal.WebView.script-dialog.html', note: 'Handles WEBKIT_SCRIPT_DIALOG_CONFIRM dialog type.')])
FutureOr<JsConfirmResponse?> Function(T controller, JsConfirmRequest jsConfirmRequest)? onJsConfirm
final

Event fired when javascript calls the confirm() method to display a confirm dialog. If JsConfirmResponse.handledByClient is true, the webview will assume that the client will handle the dialog.

jsConfirmRequest contains the message to be displayed in the confirm dialog and the of the page requesting the dialog.

Implementation

@SupportedPlatforms(
  platforms: [
    AndroidPlatform(
      apiName: 'WebChromeClient.onJsConfirm',
      apiUrl:
          'https://developer.android.com/reference/android/webkit/WebChromeClient#onJsConfirm(android.webkit.WebView,%20java.lang.String,%20java.lang.String,%20android.webkit.JsResult)',
    ),
    IOSPlatform(
      apiName: 'WKUIDelegate.webView',
      apiUrl:
          'https://developer.apple.com/documentation/webkit/wkuidelegate/1536489-webview',
    ),
    MacOSPlatform(
      apiName: 'WKUIDelegate.webView',
      apiUrl:
          'https://developer.apple.com/documentation/webkit/wkuidelegate/1536489-webview',
    ),
    LinuxPlatform(
      apiName: 'WebKitWebView::script-dialog',
      apiUrl:
          'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/signal.WebView.script-dialog.html',
      note: 'Handles WEBKIT_SCRIPT_DIALOG_CONFIRM dialog type.',
    ),
  ],
)
final FutureOr<JsConfirmResponse?> Function(
  T controller,
  JsConfirmRequest jsConfirmRequest,
)?
onJsConfirm;