MediaWiki:Gadget-HideAds.js: Difference between revisions

Want an adless experience? Log in or Create an account.
this should be a smarter way of doing it
No edit summary
(this should be a smarter way of doing it)
Line 113: Line 113:


       return document.createTextNode(content.substring(0,content.length-1));
       return document.createTextNode(content.substring(0,content.length-1));
    },
    blockKontera: function(elt) {
      childNode = disableTextAds.findKonteraText(elt);
      // Grab the inner text and replace the inserted tag with it
      if (childNode) {
        target.parentNode.replaceChild(childNode, target);
      }
     }
     }
   };
   };


   document.addEventListener('DOMNodeInserted', function(event) { disableTextAds.blockAds(event.target); }, true);
   document.addEventListener('DOMNodeInserted', function(event) { disableTextAds.blockKontera(event.target); }, true);


   // Handle the cases that don't trigger our DOMNodeInserted hook.
   // Handle the cases that don't trigger our DOMNodeInserted hook.