Greasy Fork 还支持 简体中文。

WeiboCleaner

去掉微博广告

  1. // ==UserScript==
  2. // @name WeiboCleaner
  3. // @description 去掉微博广告
  4. // @namespace http://weibo.com/qiangtoutou
  5. // @include http://*weibo.com/*
  6. // @grant unsafeWindow
  7. // @version 2015-12-06 17:04:00
  8. // ==/UserScript==
  9. (function(){
  10. var $=function(selector){
  11. if(!(this instanceof $))return new $(selector);
  12. var list=document.querySelectorAll(selector);
  13. this.data= Array.prototype.slice.call(list);
  14. return this;
  15. }
  16. $.prototype={
  17. each:function(fn){
  18. for(var i=0,len=this.data.length;i<len;i++)
  19. fn(this.data[i],i);
  20. },
  21. add:function(selector){
  22. this.data=this.data.concat($(selector).data);
  23. return this;
  24. },
  25. remove:function(){
  26. this.each(function(o){
  27. console.log(o,'被移除')
  28. o.remove();
  29. });
  30. return this;
  31. }
  32. }
  33. setInterval(function(){
  34. $('#v6_pl_ad_bottomtip')
  35. .add('#v6_pl_rightmod_attfeed')//好友关注动态
  36. .add('#v6_pl_rightmod_rank')//亚洲好书榜实时趋势
  37. .add('#v6_pl_rightmod_updatev6')
  38. .add('#v6_TrustPagelet_Recom_MusicRank')
  39. .add('#v6_pl_content_biztips')
  40. .add('#v6_pl_rightmod_ads36')
  41. .add('#v6_pl_rightmod_ads35')
  42. .add('#WB_webim')
  43. .add('.WB_ad_tm2015')
  44. .add('[feedtype=ad]')
  45. .add('[node-type=feed_spread]')
  46. .add('#v6_trustPagelet_recom_member')
  47. .add('[node-type=recommendTopic]')
  48. .add('#v6_pl_rightmod_noticeboard').remove();
  49. $('#v6_pl_rightmod_recominfo>div').each(function(module){
  50. var title=module.querySelector('.main_title a');
  51. if(title){
  52. var title=title.innerHTML;
  53. '可能感兴趣的人,电影预售榜'.split(',').forEach(function(t){
  54. if(title.indexOf(t)>-1){
  55. console.log(module,'被移除')
  56. module.remove();
  57. }
  58. });
  59. }
  60. });
  61. },400);
  62. })();