Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 54072 on
Developer Community or GitHub if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
Created attachment 20911 [details]
Minimum reproduction using Visual Studio Cross-Platform App template
I'm running into an issue where the WebView.Navigated event is incorrectly reporting the status as Failure when the actual navigation event succeeds. I've attached a minimum reproduction and screen recording of this in practice. This occurs on Android (I haven't thoroughly tested other platforms, but I think the others work fine)
Basically, if you start connected to the internet with your WebView on a cellular connection, load a page, and then turn off Cellular Data on Android, and then reload the page, and then Re-enable cellular data, then reload the page, the last page reload navigates successfully but returns a Navigated event still indicating Failure.
Steps to reproduce:
0. Start on an Android device with a cellular data connection
1. Create a ContentPage with a WebView
2. Navigate to a URL page on that WebView- Callback to Navigated indicates Success (expected)
3. Disable the cellular data
4. Navigate to a URL page on that WebView- Callback to Navigated indicates Failure (expected)
5. Re-enable the cellular data
6. Navigate to a URL page on that WebView
Expected: Callback to Navigated indicates Success
Actual: Callback to Navigated indicates Failure.
Created attachment 20912 [details]
Screen Recording showing bug in action
I was able to reproduce this issue with the attached project so I am confirming this report so the team can investigate further.
I tested with an Android 5.0 emulator and 6.0 device, and the issue also occurs after toggling wifi, not just cell data.
### Version Tests
Any updates on this?
The reason of the bug is fairly clear:
The `_navigationResult` variable is being set to `Success` only in the `ShouldOverrideUrlLoading` method; however, this method is not being called when you try to _reload_ the web page: https://developer.android.com/reference/android/webkit/WebViewClient.html#shouldOverrideUrlLoading(android.webkit.WebView, java.lang.String)
So, even if a page loads successfully, the Xamarin.Forms.WebView still receives the outdated `_navigationResult` variable from `OnPageFinished`.