Greasy Fork 支持简体中文。

Injectable AdBlocker

Simple AdBlocker

  1. // ==UserScript==
  2. // @name Injectable AdBlocker
  3. // @namespace AD BLOCK_:)
  4. // @version 1-beta
  5. // @description Simple AdBlocker
  6. // @author CyberMafia
  7. // @match *://*/*
  8. // @grant dev
  9. // ==/UserScript==
  10.  
  11. (function removeAdvertisementAndBlockingElements () {
  12. $('.inRek').remove();
  13. $('.mgbox').remove();
  14.  
  15. Array.from(document.getElementsByTagName("img")).forEach(function (e) {
  16. if (!e.src.includes(window.location.host)) {
  17. e.remove()
  18. }
  19. });
  20.  
  21. Array.from(document.getElementsByTagName("div")).forEach(function (e) {
  22. var currentZIndex = parseInt(document.defaultView.getComputedStyle(e, null).zIndex);
  23. if (currentZIndex > 999) {
  24. console.log(parseInt(currentZIndex));
  25. e.remove()
  26. }
  27. });
  28. })();