In my case, when using window.location = "http: // xxx" on my web page, the event shouldOverrideUrlLoading () does not fire.
However, if I use a custom scheme or url protocol such as "androidurl: //", OverrideUrlLoading () should be triggered. 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 changes the native protocol back to the http: // protocol, and you can process the correct URL from there.
This works for me.
source share