shouldOverrideUrlLoading does not work/catch link clicks while page is loading

情到浓时终转凉″ 提交于 2019-12-02 20:49:58

If the HTML is your own, you can replace all traditional links with calls to your own Java object, injected into the WebView via addJavascriptInterface(). Then you will no longer be reliant upon shouldOverrideUrlLoading().

Otherwise, perhaps try to prevent the user from interacting with the page until onPageFinished().

I have not run into this problem, but I have not made extensive use of WebView with arbitrary content, either.

I've had a similar issue when trying to change the webpage with js on the page that modifies window.location. Turns out that modifying the url scheme/protocol makes the webview catch on shouldOverrideUrlLoading. I know this doesn't help you since you don't own the HTML, but I thought it would help anyone else who stumbles upon this problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!