onCloseWindow property

  1. @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'WebChromeClient.onCloseWindow', apiUrl: 'https://developer.android.com/reference/android/webkit/WebChromeClient#onCloseWindow(android.webkit.WebView)'), IOSPlatform(apiName: 'WKUIDelegate.webViewDidClose', apiUrl: 'https://developer.apple.com/documentation/webkit/wkuidelegate/1537390-webviewdidclose'), MacOSPlatform(apiName: 'WKUIDelegate.webViewDidClose', apiUrl: 'https://developer.apple.com/documentation/webkit/wkuidelegate/1537390-webviewdidclose'), WebPlatform(), WindowsPlatform(apiName: 'ICoreWebView2.add_WindowCloseRequested', apiUrl: 'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.2210.55#add_windowcloserequested'), LinuxPlatform(apiName: 'WebKitWebView::close', apiUrl: 'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/signal.WebView.close.html')])
void Function(T controller)? onCloseWindow
final

Event fired when the host application should close the given WebView and remove it from the view system if necessary. At this point, WebCore has stopped any loading in this window and has removed any cross-scripting ability in javascript.

Officially Supported Platforms/Implementations:

Use the PlatformWebViewCreationParams.isPropertySupported method to check if this property is supported at runtime.

Implementation

@SupportedPlatforms(
  platforms: [
    AndroidPlatform(
      apiName: 'WebChromeClient.onCloseWindow',
      apiUrl:
          'https://developer.android.com/reference/android/webkit/WebChromeClient#onCloseWindow(android.webkit.WebView)',
    ),
    IOSPlatform(
      apiName: 'WKUIDelegate.webViewDidClose',
      apiUrl:
          'https://developer.apple.com/documentation/webkit/wkuidelegate/1537390-webviewdidclose',
    ),
    MacOSPlatform(
      apiName: 'WKUIDelegate.webViewDidClose',
      apiUrl:
          'https://developer.apple.com/documentation/webkit/wkuidelegate/1537390-webviewdidclose',
    ),
    WebPlatform(),
    WindowsPlatform(
      apiName: 'ICoreWebView2.add_WindowCloseRequested',
      apiUrl:
          'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.2210.55#add_windowcloserequested',
    ),
    LinuxPlatform(
      apiName: 'WebKitWebView::close',
      apiUrl:
          'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/signal.WebView.close.html',
    ),
  ],
)
final void Function(T controller)? onCloseWindow;