onCloseWindow method

  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')])
void onCloseWindow()

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 PlatformInAppBrowserEvents.isMethodSupported method to check if this method 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',
    ),
  ],
)
void onCloseWindow() {}