onRenderProcessGone property
- @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')])
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:
- Android WebView 26+ (Official API - WebViewClient.onRenderProcessGone)
- Windows WebView2 (Official API - ICoreWebView2.add_ProcessFailed)
- Linux WPE WebKit (Official API - WebView.web-process-terminated)
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;