-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Android: onError()
implementation is deficient
#3289
Comments
Hmm... having looked around a bit more, I see that react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewClient.java Lines 247 to 263 in 6960a19
Another inconsistency is with the current logic assuming that |
I guess, my suggestion is to:
|
β¦set loading errors as well
Hello π, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically |
The issue is not stale, the PR still waits to be merged. |
Hello π, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically |
Yes, bot, the issue is still here, as maintainers still have not merged the PR fixing it. In the meantime, the issue has been long fixed in my fork of RN WebView, which is a few steps ahead of the upstream library π |
Hello π, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically |
Bug description:
The
onError()
implementation for Android (see below), in its native layer, overrides the version ofonReceivedError()
method deprecated in Android API 23 (thus, since 2015 β this library is really well-maintained π€£ )react-native-webview/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewClient.java
Lines 211 to 216 in 6960a19
and unlike the new version of the method the old one is fired for the main resource errors only β you get the error only if it failed to load the URI passed into the
source
itself, if it failed to load assets it depends upon (like JS scripts, CSS sheets, and other stuff required by the main resource) you won't get any error, even if it breaks the page and deserves an attempt to reload the page, or some other error-handling in your host app.P.S.: As this is one is a sensitive problem for myself, I'll fix it and create PR shortly. If anybody is willing to say thanks for that, I am accepting donations via GitHub.Sponsors π
To Reproduce:
Expected behavior:
Screenshots/Videos:
Environment:
The text was updated successfully, but these errors were encountered: