-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Allow extension of WebViewDelegationHandler
in iOS
#6605
Comments
Hi @markemer thanks for picking this up. Making the change backwards-compatible with Capacitor 4 would be great if possible, we'd love to use this but are not yet in a position to upgrade to 5 🤞🏼 |
Hi @markemer We would also be interested in having the option to extend the WebViewDelegationHandler in iOS. Something like that would be awesome. Please contact me if this seems feasible to you. BR |
It's already possible to use your own But also, in Capacitor 6 |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out. |
Feature Request
Description
We are wanting to run custom crashlytics reporting within our capacitor app to get observability on any unusual spikes in webview crashes per a release. In order to do this we want to report errors within the
WKNavigationDelegate
'swebViewWebContentProcessDidTerminate
method, so that we can monitor the number of times our webviews are being terminated.At the time of writing, Capacitor on iOS sets the webview's navigation delegate to an instance of
WebViewDelegationHandler
which has a lot of extra functionality, including reloading the webview on crashes. We experimented with overwriting the webviews navigation delegate with our own custom implementation, however this caused issues as doing so removed the functionality fromWebViewDelegationHandler
.Platform(s)
iOS
Preferred Solution
Remove
internal
scoping fromWebViewDelegationHandler
to allow consumers to extend its functionality through extensions.Alternatives
I am not a strong swift developer, so am unsure if there are better alternatives. Open to any suggestions as to how else we could execute custom code when the webview is unexpectedly terminated.
Additional Context
We are able to add such override behavior on android as such:
The text was updated successfully, but these errors were encountered: