You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CAPWebView.capacitorDidLoad gets called just before capacitor loads the underlying request within the WKWebView, so consumers could create their own WKNavigationDelegate to wrap the existing WebViewDelegationHandler that is set on the WKWebView, and then wrap all of the above methods and delegate into the WebViewDelegationHandler via its conformance to WKNavigationDelegate. This is complex and brittle since it's using API that I assume Capacitor doesn't want consumers to access.
Additional Information
Thanks so much for this project!
The text was updated successfully, but these errors were encountered:
markemer
changed the title
[WebViewListener for iOS]: Provide an iOS API similar to WebViewListener on Android
[Feature]: Provide an iOS API similar to WebViewListener on Android
Feb 22, 2024
Description
Android has a WebViewListener to observe WebView health/progress. iOS should have a similar API
Platforms
Request or proposed solution
On Android,
WebViewListener
has the following callbacks:These are all available on iOS via
WKNavigationDelegate
onPageLoaded
: func webView(WKWebView, didFinish: WKNavigation!)onReceivedError
: func webView(WKWebView, didFailProvisionalNavigation: WKNavigation!, withError: any Error)onReceivedHttpError
: func webView(WKWebView, decidePolicyFor: WKNavigationResponse, decisionHandler: (WKNavigationResponsePolicy) -> Void)onPageStarted
: func webView(WKWebView, didStartProvisionalNavigation: WKNavigation!)onRenderProcessGone
: func webViewWebContentProcessDidTerminate(WKWebView)Alternatives
CAPWebView.capacitorDidLoad
gets called just before capacitor loads the underlying request within theWKWebView
, so consumers could create their ownWKNavigationDelegate
to wrap the existingWebViewDelegationHandler
that is set on theWKWebView
, and then wrap all of the above methods and delegate into theWebViewDelegationHandler
via its conformance toWKNavigationDelegate
. This is complex and brittle since it's using API that I assume Capacitor doesn't want consumers to access.Additional Information
Thanks so much for this project!
The text was updated successfully, but these errors were encountered: