onLoadStart property
- @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'WebViewClient.onPageStarted', apiUrl: 'https://developer.android.com/reference/android/webkit/WebViewClient#onPageStarted(android.webkit.WebView,%20java.lang.String,%20android.graphics.Bitmap)'), IOSPlatform(apiName: 'WKNavigationDelegate.webView', apiUrl: 'https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455621-webview'), MacOSPlatform(apiName: 'WKNavigationDelegate.webView', apiUrl: 'https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455621-webview'), WebPlatform(note: "It will be dispatched at the same time of [onLoadStop] event because there isn't any way to capture the real load start event from an iframe. If `window.location.href` isn't accessible inside the iframe, the [url] parameter will have the current value of the `iframe.src` attribute."), WindowsPlatform(apiName: 'ICoreWebView2.add_NavigationStarting', apiUrl: 'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/iwebview2webview?view=webview2-0.8.355#add_navigationstarting'), LinuxPlatform(apiName: 'WebKitWebView::load-changed', apiUrl: 'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/signal.WebView.load-changed.html', note: 'Fired when WebKitLoadEvent is WEBKIT_LOAD_STARTED.')])
final
Event fired when the WebView starts to load an url.
Officially Supported Platforms/Implementations:
- Android WebView (Official API - WebViewClient.onPageStarted)
- iOS WKWebView (Official API - WKNavigationDelegate.webView)
- macOS WKWebView (Official API - WKNavigationDelegate.webView)
- Web <iframe> but requires same origin:
- It will be dispatched at the same time of onLoadStop event because there isn't any way to capture the real load start event from an iframe. If
window.location.hrefisn't accessible inside the iframe, theurlparameter will have the current value of theiframe.srcattribute.
- It will be dispatched at the same time of onLoadStop event because there isn't any way to capture the real load start event from an iframe. If
- Windows WebView2 (Official API - ICoreWebView2.add_NavigationStarting)
- Linux WPE WebKit (Official API - WebKitWebView::load-changed):
- Fired when WebKitLoadEvent is WEBKIT_LOAD_STARTED.
Parameters - Officially Supported Platforms/Implementations:
url: all platforms
Use the PlatformWebViewCreationParams.isPropertySupported method to check if this property is supported at runtime.
Implementation
@SupportedPlatforms(
platforms: [
AndroidPlatform(
apiName: 'WebViewClient.onPageStarted',
apiUrl:
'https://developer.android.com/reference/android/webkit/WebViewClient#onPageStarted(android.webkit.WebView,%20java.lang.String,%20android.graphics.Bitmap)',
),
IOSPlatform(
apiName: 'WKNavigationDelegate.webView',
apiUrl:
'https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455621-webview',
),
MacOSPlatform(
apiName: 'WKNavigationDelegate.webView',
apiUrl:
'https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455621-webview',
),
WebPlatform(
note:
"It will be dispatched at the same time of [onLoadStop] event because there isn't any way to capture the real load start event from an iframe. If `window.location.href` isn't accessible inside the iframe, the [url] parameter will have the current value of the `iframe.src` attribute.",
),
WindowsPlatform(
apiName: 'ICoreWebView2.add_NavigationStarting',
apiUrl:
'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/iwebview2webview?view=webview2-0.8.355#add_navigationstarting',
),
LinuxPlatform(
apiName: 'WebKitWebView::load-changed',
apiUrl:
'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/signal.WebView.load-changed.html',
note: 'Fired when WebKitLoadEvent is WEBKIT_LOAD_STARTED.',
),
],
)
final void Function(T controller, WebUri? url)? onLoadStart;