NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @id KillTumblrAds // @name KillTumblrAds // @version 0.1 // @namespace com.tumblr.blocktumblrads // @author openjsalbancrommer.com // @description Blocks ads on tumblr // @include http*://www.tumblr.com* // @run-at document-start // ==/UserScript== Element.prototype.remove = function() { this.parentElement.removeChild(this); }; NodeList.prototype.remove = HTMLCollection.prototype.remove = function() { for(var i = this.length - 1; i >= 0; i--) { if(this[i] && this[i].parentElement) { this[i].parentElement.removeChild(this[i]); } } }; function removeTumblrAds(){ var domList = document.getElementsByClassName("standalone-ad-container"); for ( i=0; i < domList.length; i++ ) { console.log( "removeTumblrAds: removed 1 element"); var element = domList[i]; element.remove(); } } var MutationObserver = window.MutationObserver; var myObserver = new MutationObserver (mutationHandler); var obsConfig = { childList: true, subtree: true, attributeFilter: ['class'] }; myObserver.observe (document, obsConfig); function mutationHandler (mutationRecords) { removeTumblrAds(); } removeTumblrAds();