-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Cancel Webview Navigation using "e.cancel = true" not working #4919
Comments
Well, we're calling Anyway, we'll take a look as it's a regression and we are exposing an arg that implies we can stop the navigation! |
Hi - thanks. The issue I'm having seems is with a webview object created under the Xamarin.Forms.Webview class, and not the Android.Webkit.Webview - not sure if that makes a difference? |
@jgkent me too have the same problem. The Webview not respect the "e.Cancel = true" and keeps going on to the next link. |
the workaround that I'm using is downgrade to Xamarin.Forms v3.2 and now it's woking very well |
My issue is solved. I haven't changed any of my code, I rolled back to v3.2 last week which as we know works fine, and then 2 days ago I upgraded again to the latest version to test and it just worked. Very strange. |
what is the timeframe for the fix release? |
Have noticed the issue is actually still occurring for me. However, this issue appears twofold now:
|
Im seeing the same symptom #2 above. Didn't matter if I changed the target to _blank or _self. Seems as soon as you cancel the nav, the webview becomes unresponsive NOTE: Seems to affect Android, testing in iOS simulator was fine |
I also encountered the same problem. Can you solve this problem now? |
@jgkent Even I have a similar problem. My current Xamarin version is '3.4.0.1008975'. The Webview ignores the "e.Cancel = true" and keeps going on to the next link. @candidodmv If I will downgrade it to '3.2.', will it affect anything else in my solution? Is there any timeline on when this will be resolved? |
@prashant0590 for me the only one thing that affected was the WebView.Refresh method that isn't available in this version 3.2, but i suggets to you review and compare both release notes for more details |
@prashant0590 answering the second question: Is there any timeline on when this will be resolved? |
I got fed up with it. For those that have the time or inclination, I spent 5 days ripping out the Xamarin.Forms.Webview, and have rebuilt the app using the Xamarin.Webkit.Webview instead. Syntax is different, but once you get a handle on it, it works well. Not experienced any of the weird behaviour as with the Forms.Webview. |
Hello, are you saying that you have solved this problem now? If so, can you provide your code? |
@Topsking I have not solved the issue, I am simply no longer using the Xamarin.Forms.Webview class. I am now using the Xamarin.Webkit.Webview class, as per: https://developer.xamarin.com/api/type/Android.Webkit.WebView/ The issue with the Xamarin.Forms.Webview class remains as far as the other users above report. |
Same here, only in android Xamarin.Forms 3.4.0.1029999. |
Same here. v3.5. A response from Xamarin would be nice. |
…n#4891 fixes xamarin#4919 closes xamarin#5460 * [Android] Fixes cancel Webview Navigation * - added fix 4891 - refactoring * Fix obsolete message Co-authored-by: Ralph Brackert <[email protected]>
Have two separate Android apps running, both using a webview.
If the webview receives a URL which contains a "target=blank" parameter, this would open the link in the device's browser using Device.OpenUri(uri), and would cancel the navigation within the webview in the app. This was working fine using version 3.2.0 (have just rolled back and can confirm this still works), but after upgrading to version 3.4.0, in both apps, the link does open in the external browser, BUT also navigates within the app too. Therefore, it appears the "e.cancel = true;" seems to have ceased functioning here.
Steps to Reproduce
Expected Behavior
The first link will open in the external browser and navigation stops in the app. The second link will open in the app.
Actual Behavior
in 3.2, it works fine. In 3.4, the first opens both in the external browser, but also in the app. Navigation is not cancelled.
Basic Information
The text was updated successfully, but these errors were encountered: