2016-03-15 59 views

回答

0

我已經使用它,它的工作正常彈出點擊禁用。

webview.setWebViewClient(new WebViewClient() { 
    @Override 
    public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) 
    { 
    } 

    @Override 
    public boolean shouldOverrideUrlLoading(WebView view, String url) { 
     return true; 
    } 

    @Override 
    public void onPageFinished(WebView view, String url) { 
     super.onPageFinished(view, url); 
    } 

    @Override 
    public void onPageStarted(WebView view, String url, Bitmap favicon) { 
     super.onPageStarted(view, url, favicon); 
    } 
}) 
2
webview.setWebViewClient(new WebViewClient() { 
     @Override 
     public void onReceivedError(WebView view, int errorCode, 
            String description, String failingUrl) { 

     } 

     @Override 
     public boolean shouldOverrideUrlLoading(WebView view, String url) { 
      view.loadUrl(url); 
      return true; 
     } 

     @Override 
     public void onPageFinished(WebView view, String url) { 
      super.onPageFinished(view, url); 
      webview.loadUrl("javascript:(function() { " + 
        "document.getElementsByClassName('ndfHFb-c4YZDc-GSQQnc-LgbsSe ndfHFb-c4YZDc-to915-LgbsSe VIpgJd-TzA9Ye-eEGnhe ndfHFb-c4YZDc-LgbsSe')[0].style.display='none'; })()"); 
     } 

     @Override 
     public void onPageStarted(WebView view, String url, Bitmap favicon) { 
      super.onPageStarted(view, url, favicon); 

     } 
    }) 
+0

它沒有工作。 –

+0

@LalitKhandelwal:它應該工作,請檢查 – jaffar

相關問題