V2ex-helper

1.去除v2ex广告 2.添加百度和bing搜索

  1. // ==UserScript==
  2. // @name V2ex-helper
  3. // @description 1.去除v2ex广告 2.添加百度和bing搜索
  4. // @copyright 2018, lhr(https://www.lhrsite.com/)
  5. // @version 1.2.0
  6. // @author lhr
  7. // @license MIT
  8. // @homepageURL https://github.com/zzlhr/tampermonkey-script/blob/master/v2ex/
  9. // @grant none
  10. // @run-at document-end
  11. // @include https://*.v2ex.com/*
  12. // @namespace https://gf.qytechs.cn/users/194548
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17. console.log('插件已加载');
  18. var sidebar_units = $('.sidebar_units');
  19. for(var i=0;i<sidebar_units.length;i++){
  20. $(sidebar_units[i]).attr('hidden','');
  21. }
  22.  
  23. var sidebar_compliances = $('.sidebar_compliance');
  24. for(i=0;i<sidebar_compliances.length;i++){
  25. $(sidebar_compliances[i]).attr('hidden','');
  26. }
  27.  
  28. var googles = $('.adsbygoogle');
  29. console.log(googles)
  30. for(i=0;i<googles.length;i++){
  31. $(googles[i]).parent().parent().attr('hidden','')
  32. }
  33.  
  34. $('#Search').children('form').html($('#Search').children('form').html() +
  35. '<a id="baidu" style="padding-right:5px;" href="https://www.baidu.com/s?wd=site: www.lhrsite.com">百度</a><a id="google" href="https://www.google.com/search?q=site: www.lhrsite.com" style="padding-right:5px;">google</a><a href="https://cn.bing.com/search?q=site: www.lhrsite.com" style="padding-right:5px;" id="bing">bing</a>')
  36. //修改查询
  37. var base=['https://www.baidu.com/s?wd=site: v2ex.com ', 'https://www.google.com/search?q=site: v2ex.com/t ', 'https://cn.bing.com/search?q=site: v2ex.com/t ']
  38.  
  39.  
  40. $('#qbar').children('input').change(function(){
  41. var value = $('#qbar').children('input').val()
  42. $('#baidu').attr('href', base[0]+value);
  43. $('#google').attr('href', base[1]+value);
  44. $('#bing').attr('href', base[2]+value);
  45. });
  46.  
  47.  
  48.  
  49. //======2018-07-18 09:17:49=====
  50. //==========修改广告规则==========
  51. var inners = $('.inner');
  52. console.log(inners)
  53. for (i=0;i<inners.length;i++){
  54. var item = inners[i]
  55. item = $(item)
  56. if(item.attr('align') === 'center'){
  57. console.log(item)
  58. item.hide()
  59. }
  60.  
  61. }
  62. // Your code here...
  63. })();

QingJ © 2025

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