onRenderProcessGone property

  1. @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'WebViewClient.onRenderProcessGone', apiUrl: 'https://developer.android.com/reference/android/webkit/WebViewClient#onRenderProcessGone(android.webkit.WebView,%20android.webkit.RenderProcessGoneDetail)', available: '26'), WindowsPlatform(apiName: 'ICoreWebView2.add_ProcessFailed', apiUrl: 'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.2849.39#add_processfailed'), LinuxPlatform(apiName: 'WebView.web-process-terminated', apiUrl: 'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/WebKitWebView.html#WebKitWebView-web-process-terminated')])
void Function(T controller, RenderProcessGoneDetail detail)? onRenderProcessGone
final

Event fired when the given WebView's render process has exited. The application's implementation of this callback should only attempt to clean up the WebView. The WebView should be removed from the view hierarchy, all references to it should be cleaned up.

To cause an render process crash for test purpose, the application can call load url "chrome://crash" on the WebView. Note that multiple WebView instances may be affected if they share a render process, not just the specific WebView which loaded "chrome://crash".

detail the reason why it exited.

Officially Supported Platforms/Implementations:

Parameters - Officially Supported Platforms/Implementations:

  • detail: all platforms

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

Implementation

@SupportedPlatforms(
  platforms: [
    AndroidPlatform(
      apiName: 'WebViewClient.onRenderProcessGone',
      apiUrl:
          'https://developer.android.com/reference/android/webkit/WebViewClient#onRenderProcessGone(android.webkit.WebView,%20android.webkit.RenderProcessGoneDetail)',
      available: '26',
    ),
    WindowsPlatform(
      apiName: 'ICoreWebView2.add_ProcessFailed',
      apiUrl:
          'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.2849.39#add_processfailed',
    ),
    LinuxPlatform(
      apiName: 'WebView.web-process-terminated',
      apiUrl:
          'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/WebKitWebView.html#WebKitWebView-web-process-terminated',
    ),
  ],
)
final void Function(T controller, RenderProcessGoneDetail detail)?
onRenderProcessGone;