Guest User

Untitled

a guest
Jan 21st, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. private class CustomWebClient extends WebViewClient {
  2. @Override
  3. public void onPageFinished(WebView view, String url) {
  4. progress.setVisibility(View.GONE);
  5. super.onPageFinished(view, url);
  6. }
  7.  
  8. @Override
  9. public void onPageStarted(WebView view, String url, Bitmap favicon) {
  10. super.onPageStarted(view, url, favicon);
  11. }
  12.  
  13. @Override
  14. public boolean shouldOverrideUrlLoading(WebView view, String url) {
  15. doGet(url);
  16. return true; // super.shouldOverrideUrlLoading(view, url);
  17. }
  18.  
  19. public void onLoadResource(WebView view, String url) {
  20. webview.loadUrl("javascript:(function() { "
  21. + "document.getElementsByTagName('header')[0].style.display = 'none'; "
  22. + "})()");
  23.  
  24. webview.loadUrl("javascript:(function() { "
  25. + "document.getElementsByTagName('footer')[0].style.display = 'none'; "
  26. + "})()");
  27.  
  28. webview.loadUrl("javascript:(function() { "
  29. + "document.getElementsByTagName('section').search_again.style.display = 'none'; "
  30. + "})()");
  31. }
  32.  
  33. }
Add Comment
Please, Sign In to add comment