WebAdRule Extra Script

This script is an extension of the Web Ad Rule to fix something that easylist can't handle

当前为 2025-01-02 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name WebAdRule Extra Script
  3. // @version 1.0.0
  4. // @namespace http://tampermonkey.net/
  5. // @match *://*.51cto.com/*
  6. // @match *://*.segmentfault.com/*
  7. // @match *://golang.iswbm.com/*
  8. // @match *://python.iswbm.com/*
  9. // @match *://www.w3cschool.cn/*
  10. // @match *://juejin.cn/*
  11. // @match *://*.didispace.com/*
  12. // @match *://www.appinn.com/*
  13. // @match *://fuliba2023.net/*
  14. // @match *://fuliba2024.net/*
  15. // @match *://fuliba2025.net/*
  16. // @grant GM_addStyle
  17. // @run-at document-start
  18. // @require https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.6.0/jquery.min.js
  19. // @author xndeye
  20. // @description This script is an extension of the Web Ad Rule to fix something that easylist can't handle
  21. // @license MIT
  22. // ==/UserScript==
  23. (function () {
  24. 'use strict';
  25. })();
  26.  
  27.  
  28. let domain = null;
  29. function getdomain() {
  30. if (!domain) {
  31. domain = document.location.hostname.split('.').slice(-2).join('.')
  32. console.log('<WebAdRule Extra Script> : ' + domain)
  33. }
  34. return domain ? domain : ''
  35. }
  36.  
  37. /**
  38. * Inject on document-start
  39. */
  40. switch (getdomain()) {
  41. case '51cto.com':
  42. break
  43. case 'segmentfault.com':
  44. break
  45. case 'iswbm.com':
  46. window.addEventListener('scroll', () => {
  47. let scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
  48. let clientHeight = document.documentElement.clientHeight || document.body.clientHeight
  49. let scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight
  50. let scrollBottom = scrollHeight - scrollTop - clientHeight;
  51. if (scrollBottom <= 100) {
  52. $('#read-more-wrap').remove();
  53. $('.wy-nav-content .rst-content').removeAttr('style');
  54. }
  55. }, false)
  56. break;
  57. case 'w3cschool.cn':
  58. break;
  59. case 'juejin.cn':
  60. break;
  61. case 'didispace.com':
  62. break;
  63. case 'appinn.com':
  64. break;
  65. case 'fuliba2023.net':
  66. case 'fuliba2024.net':
  67. case 'fuliba2025.net':
  68. GM_addStyle('.content-wrap .content {margin-right: 0; !important;}')
  69. break;
  70. }
  71.  
  72. /**
  73. * Execute after page load
  74. */
  75. window.onload = function () {
  76. switch (getdomain()) {
  77. case '51cto.com':
  78. $("[class^='ad-']").remove();
  79. setTimeout(function () {
  80. $(".copy_btn").each(function () {
  81. $(this).text('复制');
  82. this.setAttribute('class', 'copy-r');
  83. this.onclick = function () {
  84. var item = $(this.getAttribute('data-clipboard-target'));
  85. if (item[0].tagName === 'CODE') {
  86. navigator.clipboard.writeText(item.text())
  87. } else {
  88. navigator.clipboard.writeText(item.siblings().text());
  89. }
  90. }
  91. });
  92. }, 1000);
  93. break;
  94. case 'iswbm.com':
  95. $('.wy-nav-content').attr('style', 'max-width: none');
  96. $('#read-more-wrap').remove();
  97. $('.wy-nav-content .rst-content').removeAttr('style');
  98. break;
  99. case 'juejin.cn':
  100. document.oncopy = event => event.clipboardData.setData('text', window.getSelection(0).toString());
  101. $('a[href]').each(function () {
  102. console.log($(this).html());
  103. let link = $(this).attr('href').replace('https://link.juejin.cn?target=', '');
  104. if (typeof link !== 'undefined') {
  105. $(this).attr('href', decodeURIComponent(link));
  106. }
  107. })
  108. break;
  109. case 'didispace.com':
  110. $('article').attr('style', 'height: none');
  111. $('.read-more-wrap').remove();
  112. break;
  113. case 'appinn.com':
  114. $('.latestPost').each(function () {
  115. if ($(this).find("a[title='View all posts in 团购']").length > 0 ||
  116. $(this).find("a[title='View all posts in AD']").length > 0) {
  117. $(this).attr("style", "display: none !important;")
  118. }
  119. })
  120. break;
  121. case 'fuliba2023.net':
  122. case 'fuliba2024.net':
  123. case 'fuliba2025.net':
  124. $('span[style]').attr('style', 'color: green; !important;')
  125. $('.excerpt').each(function () {
  126. if ($(this).find('.cat').text().includes('购物网赚')) {
  127. $(this).remove()
  128. }
  129. })
  130. break;
  131.  
  132. case 'segmentfault.com':
  133. $('.article a[href]').each(function () {
  134. if ($(this).attr('href').startsWith('https://link.segmentfault.com')) {
  135. $(this).attr('href', $(this).text());
  136. }
  137. })
  138. break;
  139. default:
  140. break;
  141. }
  142. }

QingJ © 2025

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