Block Baidu Hot List

Just Block Baidu Hot List

  1. // ==UserScript==
  2. // @name Block Baidu Hot List
  3. // @name:zh-CN 百度热点搜索屏蔽
  4. // @namespace h
  5. // @version 1.1
  6. // @description Just Block Baidu Hot List
  7. // @description:zh-CN 百度热点搜索栏目屏蔽
  8. // @author hoothin
  9. // @include http*://www.baidu.com/*
  10. // @include http*://m.baidu.com/*
  11. // @grant none
  12. // @run-at document-start
  13. // @license MIT License
  14. // @compatible chrome 测试通过
  15. // @compatible firefox 未测试
  16. // @compatible opera 未测试
  17. // @compatible safari 未测试
  18. // @contributionURL null
  19. // @contributionAmount 1
  20. // ==/UserScript==
  21.  
  22. (function() {
  23. 'use strict';
  24.  
  25.  
  26.  
  27. function addLoadEvent(func) {
  28. var oldonload = window.onload;
  29. if (typeof window.onload != 'function') {
  30. window.onload = func;
  31. } else {
  32. window.onload = function() {
  33. oldonload();
  34. func();
  35. };
  36. }
  37. }
  38.  
  39.  
  40.  
  41. function t(){
  42. $(".opr-toplist-table").remove();
  43. $(".opr-recommends-merge-panel").remove();
  44. $(".opr-recommends-merge-mbGap").remove();
  45. console.log(" hot list table removed !");
  46. }
  47.  
  48. if('undefined' === typeof window.jQuery){
  49. addLoadEvent(t);
  50. }else{
  51. t();
  52. console.log("biu~");
  53. }
  54.  
  55. var setInterval_id;
  56.  
  57. setInterval_id = setInterval(function(){
  58. if(document.querySelector("#content_right") ){
  59. $$("#content_right",'remove','all');
  60. //clearInterval(setInterval_id);
  61. }
  62. },100);
  63.  
  64. function $$(selector,operation,nodes_model){
  65. var model = nodes_model || 'one';
  66.  
  67. switch(operation){
  68.  
  69. case 'hide':
  70. if( model =='one' ){
  71. var page_ele = document.querySelector(selector) ;
  72. if(!page_ele){
  73. return;
  74. }
  75. page_ele.style.display = "none" ;
  76. }else{
  77. var arr = document.querySelectorAll(selector);
  78. if(!arr){
  79. return;
  80. }
  81. Array.prototype.forEach.call(arr,function(e){e.style.display = "none";});
  82.  
  83. }
  84. break;
  85.  
  86.  
  87. case 'remove':
  88. if( model =='one' ){
  89. var page_elem = document.querySelector(selector) ;
  90. if(!page_elem){
  91. return;
  92. }
  93. page_elem.parentNode.removeChild(page_elem);
  94. }else{
  95. var arr_remove = document.querySelectorAll(selector);
  96. if(!arr_remove){
  97. return;
  98. }
  99. Array.prototype.forEach.call(arr_remove,function(e){e.parentNode.removeChild(e);});
  100. }
  101. break;
  102.  
  103. default:
  104. if(model ==='one'){
  105. return document.querySelector(selector) ;
  106. }else{
  107. return document.querySelectorAll(selector);
  108. }
  109. }
  110. }
  111.  
  112. })();

QingJ © 2025

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