Android WebView - Intercept URL loading
<p>I'm trying to determine the successful payment event from the payment portal. 
You might know this process: you send a 'callback URL' as one of other parameters to the payment website. When the payment is made the website re-directs the browser to your 'callback URL'.</p>

<p>Since this is Android application I specify a custom url with a custom scheme ('myapp://order/123') as a 'callback URL'
Then I use the following technique to intercept the re-direct to my 'callback URL' to do some custom action.</p>

<pre><code>mWebView.setWebViewClient(new WebViewClient() {
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            LOG.info("Inside shouldOverrideUrlLoading(), url: {}", url);

            if (url.startsWith("myapp://")) {
                onPaymentPerformed();
                return true;
            } else {
                return false;
            }
        }
}
</code></pre>

<p>It worked for many months but recently it started failing. I don't know why but probably due to device updates. This method has stopped being called for 'myapp://' url. I've checked the logs and found the following message</p>

<p><code>I/chromium: [INFO:CONSOLE(2174)] "Mixed Content: The page at 'https://www.liqpay.com/en/checkout/success/xxxx' was loaded over a secure connection, but contains a form which targets an insecure endpoint 'myapp://order/7'. This endpoint should be made available over a secure connection.", source: https://static.liqpay.com/checkout/160922113118/js/index.js (2174)</code></p>

<p>Then I tried to change 'myapp://order/123' to '<a href="https://order/123" rel="nofollow">https://order/123</a>' but the method shouldOverrideUrlLoading() is also not called for this url, instead I see a standard error message in the webview: </p>

<pre><code>The webpage at https://order/123 could not be loaded because: net::ERR_NAME_NOT_RESOLVED
</code></pre>

<p>I found nothing similar to this on Internet, please help</p>