dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.21k stars 1.75k forks source link

Maui Android WebView ShouldOverrideUrlLoading is not calling when we set CustomWebViewClient #25626

Open letscodewithkalyan opened 6 days ago

letscodewithkalyan commented 6 days ago

Description

When we added Custom Mauiwebview client In Android ShouldOverrideUrlLoading is not firing in android

Steps to Reproduce

No response

Link to public reproduction project repository

https://github.com/letscodewithkalyan/MauiWebViewIssue

Version with bug

8.0.91 SR9.1

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

No response

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

jfversluis commented 6 days ago

Related to https://github.com/dotnet/maui/issues/11004?

letscodewithkalyan commented 5 days ago

@jfversluis "ShouldInterceptRequest" method Is calling fine but "ShouldOverrideUrlLoading" is not firing.

ninachen03 commented 5 days ago

This issue has been verified using Visual Studio 17.12.0 Preview 5(9.0.0-rc.2.24503.2 & 8.0.92 & 8.0.3). Can repro this issue at android platform.

mlyga commented 3 days ago

ShouldOverrideUrlLoading is firing for me when I go to the other page from the first page that has been loaded initially. But it is not firing for the first loading.

Methods are called in this order after the CustomWebView appears on the page: ... ShouldInterceptRequest ... OnPageFinished ...

Then I go to some other page: ... ShouldInterceptRequest ... ShouldOverrideUrlLoading ... OnPageFinished ...