Created
January 29, 2019 04:13
-
-
Save lazd/0dd7bc5d5cbb0f7a6739b393aba96fd0 to your computer and use it in GitHub Desktop.
Tampermonkey script to kill Reddit Ads
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Reddit Ad Killer | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Nobody cares about TripleByte | |
// @author Larry Davis | |
// @match https://www.reddit.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function killAds() { | |
var spans = document.querySelectorAll('div >div >div >div > span[class]'); | |
Array.prototype.forEach.call(spans, function(span) { | |
if (span.textContent === 'promoted') { | |
var ad = span.parentNode.parentNode.parentNode.parentNode.parentNode; | |
ad.parentNode.removeChild(ad); | |
} | |
}); | |
} | |
killAds(); | |
setInterval(killAds, 2500); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment