maomao

在这个网站上屏蔽广告

  1. // ==UserScript==
  2. // @name maomao
  3. // @namespace http://mfff56.com/miey/*
  4. // @version 0.1
  5. // @description 在这个网站上屏蔽广告
  6. // @author You
  7. // @include http://mfff56.com/*.html
  8. // @include http://mfff60.com/*.html
  9. // @include http://mfff61.com/*.html
  10. // @include http://mfff62.com/*.html
  11.  
  12.  
  13. // @grant none
  14. // ==/UserScript==
  15.  
  16. (function() {
  17. 'use strict';
  18. // 绑定body事件
  19. document.querySelector("body").setAttribute("onkeydown","whichButton(event)");
  20.  
  21. window.whichButton = function (){
  22. // A S 上下页
  23. if(event.keyCode==65){
  24. try{document.querySelector("body > div:nth-child(10) > div.mainAreaBlack > h3:nth-child(1) > span.last > a").click();}catch(e){};
  25. try{document.querySelector("body > div.center.margintop.border.clear.main > div.pagea > a:nth-child(1)").click();}catch(e){};
  26. }
  27. if(event.keyCode==83){
  28. try{document.querySelector("body > div:nth-child(10) > div.mainAreaBlack > h3:nth-child(1) > span.next > a").click();}catch(e){};
  29. try{document.querySelector("body > div.center.margintop.border.clear.main > div.pagea > a:nth-child(3)").click();}catch(e){};
  30. }
  31. }
  32.  
  33.  
  34. var auto = setInterval(function(){
  35. console.log("del ad ...");
  36. var url = window.location.href;
  37. try{document.querySelector("body > div.nav_bar").style.display="none";}catch(e){};
  38. try{document.querySelector("body > div.bdshare-slide-button-box.bdshare-slide-style-r5").style.display="none";}catch(e){};
  39.  
  40. try{document.querySelector("#span_ed1").style.display="none";}catch(e){};
  41. try{document.querySelector("#span_ed2").style.display="none";}catch(e){};
  42.  
  43. try{document.querySelector("#span_ed3").style.display="none";}catch(e){};
  44. try{document.querySelector("#span_ed4").style.display="none";}catch(e){};
  45.  
  46. try{document.querySelector("#span_ed5").style.display="none";}catch(e){};
  47. try{document.querySelector("#span_ed7").style.display="none";}catch(e){};
  48. try{document.querySelector("#span_ed8").style.display="none";}catch(e){};
  49.  
  50. // 导航栏 列表页
  51. if (url.indexOf("gera")!=-1 || url.indexOf("liuc")!=-1){
  52. try{document.querySelector("body > div.layout").style.display="none";}catch(e){};
  53. try{document.querySelectorAll("body > div.layout.mt10")[0].style.display="none";}catch(e){};
  54. try{document.querySelectorAll("body > div.layout.mt10")[1].style.display="none";}catch(e){};
  55. try{document.querySelectorAll("body > div.layout.mt10")[3].style.display="none";}catch(e){};
  56.  
  57. // liuc
  58. try{document.querySelector("body > div.center.border.top").style.display="none";}catch(e){};
  59. try{document.querySelector("body > div.center.margintop.border.clear.menu").style.display="none";}catch(e){};
  60. }
  61. document.querySelector("body > div.center.border.top")
  62.  
  63. // 图片页
  64. if (url.indexOf("miey")!=-1){
  65. try{document.querySelector("body > div.layout").style.display="none";}catch(e){};
  66. try{document.querySelectorAll("body > div.layout.mt10")[0].style.display="none";}catch(e){};
  67. try{document.querySelectorAll("body > div.layout.mt10")[1].style.display="none";}catch(e){};
  68. try{document.querySelectorAll("body > div.layout.mt10")[2].style.display="none";}catch(e){};
  69. try{document.querySelectorAll("body > div.layout.mt10")[4].style.display="none";}catch(e){};
  70. }
  71. if(url.indexOf("rrxz")!=-1){
  72. try{document.querySelector("body > div.center.border.top").style.display="none";}catch(e){};
  73. try{document.querySelector("body > div.center.margintop.border.clear.menu").style.display="none";}catch(e){};
  74.  
  75. }
  76.  
  77. },100);
  78.  
  79. // Your code here...
  80. })();