BiMi去广告脚本

小庄的脚本园

  1. // ==UserScript==
  2. // @name BiMi去广告脚本
  3. // @namespace http://bimiacg*.*/*
  4. // @version 2.4
  5. // @description 小庄的脚本园
  6. // @author zjazn
  7. // @match *://bimiacg4.net/*
  8. // @match *://*.bimiacg4.net/*
  9. // @match *://*.*.bimiacg4.net/*
  10. // @grant GM_getValue
  11. // @grant GM.getValue
  12. // @grant GM_setValue
  13. // @grant GM.setValue
  14. // @run-at document-start
  15. // @license MIT
  16. // @match <$URL$>
  17. // ==/UserScript==
  18.  
  19.  
  20. (function () {
  21. var i=0;
  22. //脚本框架-自建
  23. function $(str,two,three) {
  24. if((typeof str) == "function") {
  25. var n = 0;
  26. var timeout = setInterval(function() {
  27. //关键代码开始
  28. if(two != null) {
  29. if($(two).exist(three==null?0:three)) {
  30. str();
  31. clearInterval(timeout);
  32. }
  33. }else {
  34. str();
  35. }
  36. //关键代码结束
  37. n++
  38. if(n>12500) {
  39. clearInterval(timeout);
  40. }
  41.  
  42. },40)
  43. return;
  44. }
  45.  
  46. let objs = [];
  47. let objs_str = str.split(",");
  48.  
  49. for(var i = 0; i < objs_str.length; i++) {
  50. var inter = document.querySelectorAll(objs_str[i]);
  51. for(var j = 0; j < inter.length; j++) {
  52. objs[objs.length] = inter[j];
  53. }
  54. }
  55.  
  56. let ctl = {
  57. //给元素添加一个监听事件
  58. listen: function(event,fun) {
  59. for(var i = 0; i < objs.length; i++) {
  60. objs[i].addEventListener(event, fun);
  61. }
  62.  
  63. },
  64. //当存在元素且length大于或等于count时返回true
  65. exist: function(count) {
  66. return (objs[0] != null) && objs.length >=count ;
  67. },
  68.  
  69. css: function(style_str) {
  70. for(var i = 0; i < objs.length; i++) {
  71. if(objs[i] != null) {
  72. objs[i].style=style_str
  73. }
  74. }
  75. return ctl;
  76. },
  77. os: objs,
  78. //将指针转向指定对象的n父对象
  79. father: function(second, vt) {
  80. let fathers = objs;
  81. for(var j = 0; j < second; j++) {
  82. var new_father = [];
  83. for(var i = 0; i < fathers.length; i++) {
  84.  
  85. new_father[new_father.length] = fathers[i].parentNode;//获取a的父节点;
  86. }
  87. fathers = new_father;
  88. }
  89. objs = fathers;
  90. console.log("最终父节点:",objs);
  91. return ctl;
  92. },
  93. //排除父子关系
  94. exfs: function() {
  95. for(var i = 0; i < objs.length; i++) {
  96. if(objs[i].querySelectorAll(str.split(",")[0]).length > 0) {
  97. objs.splice(i, 1);
  98. //console.log("存在",objs);
  99. }
  100.  
  101. }
  102. return ctl;
  103. }
  104.  
  105.  
  106. }
  107. return ctl;
  108. }
  109.  
  110.  
  111. //去广告代码
  112. $(function() {
  113. $("#HMRichBox").css("display:none;")
  114. },"#HMRichBox",1)
  115.  
  116. $(function() {
  117. $(".tuiguang").css("display:none;")
  118. $("#bkcl").css("display:none");
  119.  
  120. },".tuiguang",1)
  121.  
  122. $(function() {
  123. $("#HMcoupletDivleft").css("overflow: hidden;display:none;")
  124. $("#HMcoupletDivright").css("overflow: hidden;display:none;")
  125.  
  126. },"#HMcoupletDivright,#HMcoupletDivleft",1)
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址