去掉广告的代码

 public void removeSmartTAOBAOad()
    {
        uiwebview.loadUrl("javascript:"+
        "var evt = document.createEvent('MouseEvents');"+
        "evt.initEvent('click', true, true);"+
        "var i=0;"+
        "setTimeout(function(){check_click()}, 300);"+
        "function check_click(){"+
            "var close = document.getElementById('smartAd-close');"+
            "if(typeof close != 'undefined')"+
                "close.dispatchEvent(evt);"+
            "else if(i <= 10)"+
                "setTimeout(function(){check_click();}, 300);"+
            "i+=1;"+
        "};");


    }

 @Override
        public void onPageFinished(WebView view, String url) {
            progressBar.setVisibility(View.INVISIBLE);
            removeSmartTAOBAOad();
        }

你可能感兴趣的:(代码)