NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Know Your Meme Cleanser // @namespace http://pixelstomp.com/ // @version 2.2 // @description Removes ads, whitelisting messages, and other spammy nonsense from Know Your Meme. // @author intrepidOlivia // @match *://*.knowyourmeme.com/* // @copyright 2018 - 2021, intrepidOlivia (https://openuserjs.org//users/intrepidOlivia) // @icon https://knowyourmeme.com/assets/favicons/favicon-32x32.png // @license MIT // ==/UserScript== (function() { 'use strict'; function removeElements(selector, exception) { const elems = document.querySelectorAll(selector); for (let i = 0; i < elems.length; i++) { if (exception) { if (!exception(elems[i])) { elems[i].remove(); } } else { elems[i].remove(); } } } function iframeException(elem) { let isException = false; // Allow iFrames for things like Google Analytics const EXCLUDED_PARENT_CLASSES = ['google-trends-embed-wrapper']; const parentClasses = Array.from(elem.parentElement.classList); for (let className of EXCLUDED_PARENT_CLASSES) { if (parentClasses.includes(className)) { isException = true; } } // Allow Youtube embeds if (elem.src && elem.src.includes('youtube.com')) { isException = true; } return isException; } const bulldozer = setInterval(() => { removeElements('.blocker'); removeElements('#leaderboard'); removeElements('#trending-bar'); removeElements('iframe', iframeException); removeElements('#anyclip'); removeElements('#pmc-atlasmg-adhesion-bar'); removeElements('.sticky-sidebar'); removeElements('.entry-insert'); removeElements('.ac-widget-placeholder'); }, 1000); })();