Greasy Fork is available in English.

Geenstijl add remover

Remove adds articles from Geenstijl.nl

// ==UserScript==
// @name         Geenstijl add remover
// @namespace    https://www.geenstijl.nl/
// @version      0.7
// @description  Remove adds articles from Geenstijl.nl
// @author       Rick van der Staaij
// @require      http://code.jquery.com/jquery-latest.min.js
// @include      https://www.geenstijl.nl/*
// @grant        none
// @license MIT
// ==/UserScript==

function removeAddArticles() {
    let cleanCounter = 0;
    $('article').each(function() {
        if ($(this).find(".compost-warn:contains('Ingezonden mededeling')").length > 0) {
            cleanCounter++;
            $(this).remove();
        }
    });
    if (cleanCounter > 0) {
        console.log('[Geenstijl add killer] Removed ' + cleanCounter + ' spam cards.');
    }
}

function removePromoBlocks() {
    console.log('[Geenstijl add killer] Cleaning crap.');
    $('.article-premium-promotion-block, .pgAdWrapper, .become-premium, .modal-float-in, .not-a-pixel, div[data-page="site_index.homepage"], .afctr-wrapper').remove();
}

function clean() {
    removePromoBlocks();
    removeAddArticles();
    setTimeout(function() { removePromoBlocks(); }, 1000);
}

(function() {
    'use strict';

    console.log('[Geenstijl add killer] Killing spam...');
    clean();

    var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;

    var observer = new MutationObserver(function(mutations, observer) {
        clean();
    });

    observer.observe(document, {
        subtree: true,
        attributes: true,
    });

    $( document ).ready(function() { clean(); });
    $( window ).on( "load", function() { clean(); });
})();