Block all ads (Undetectable)

Blocks all ads on the current webpage in an undetectable way

  1. // ==UserScript==
  2. // @name Block all ads (Undetectable)
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Blocks all ads on the current webpage in an undetectable way
  6. // @author JXJ
  7. // @match *://*/*
  8. // @grant none
  9. // @run-at document-start
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. var observer = new MutationObserver(function(mutations) {
  15. mutations.forEach(function(mutation) {
  16. if (mutation.addedNodes) {
  17. for (var i = 0; i < mutation.addedNodes.length; i++) {
  18. var node = mutation.addedNodes[i];
  19. if (node.nodeType === 1 && node.nodeName === "IFRAME") {
  20. node.style.display = "none";
  21. node.style.visibility = "hidden";
  22. }
  23. }
  24. }
  25. });
  26. });
  27. observer.observe(document.body, {
  28. childList: true,
  29. subtree: true
  30. });
  31. })();