In my case, when using window.location = "http://xxx" on my web page, the event shouldOverrideUrlLoading() does not shouldOverrideUrlLoading() .
However, if I use a custom URL scheme or protocol, for example androidurl:// , shouldOverrideUrlLoading() . My workaround would be to use my own protocol and add the following code to the shouldOverrideUrlLoading() method:
if (url.startsWith("androidurl://")) { url = url.replaceAll("androidurl://", "http://"); }
This will change the native protocol to http:// and you can process the correct URL.
This works for me.
source share