Don't navigate to other pages in WebView,disable links and references

后端 未结 8 1773
再見小時候
再見小時候 2020-12-25 12:02

I have a webView in Android, and I open a html webpage in it. But it\'s full of links and images, and when I click one of them, it loads in my webview. I want to disable thi

8条回答
  •  清酒与你
    2020-12-25 12:38

    Using inject javascript On @Override onPageFinished

    view.loadUrl(
        javascript: (function () {
    
    
            document.addEventListener('click', function (e) {
                e.stopPropagation();
            }
                , true);
    
        })()
    );
    

提交回复
热议问题