morteng / Anti anti-adblock til danske sites

// ==UserScript==
// @name         Anti anti-adblock til danske sites
// @namespace    http://hestfiskslange
// @version      1.4
// @description  Blocker irriterende anti-adblocker warning på diverse danske sider.
// @author       rmjdk
// @match        *://ekstrabladet.dk/*
// @match        *://jyllands-posten.dk/*
// @match        *://motion-online.dk/*
// @match        *://politiken.dk/*
// @match        *://tipsbladet.dk/*
// @grant        none
// @require   		http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// ==/UserScript==

$(document).ready(function() {
    var antiAdblockMappings = [];

    antiAdblockMappings.push({
        site: "jyllands-posten.dk",
        elementSelector: "div[class*=userOverlay]"});
    antiAdblockMappings.push({
        site: "jyllands-posten.dk",
        elementSelector: "div[id*=overlay]"});
    antiAdblockMappings.push({
        site: "ekstrabladet.dk",
        elementSelector: "div.p-absolute",
        fn: function (el) { $(el).parent().remove(); }});
    antiAdblockMappings.push({
        site: "motion-online.dk",
        elementSelector: "div.adb",
        fn: function (el) { $(el).remove(); }});
    antiAdblockMappings.push({
        site: "politiken.dk",
        elementSelector: ".modal--adblockblocker",
        fn: function (el) {
            $(el).parent().parent().remove();
            $("body").removeClass("dit-modal-open");
        }});
    antiAdblockMappings.push({
        site: "tipsbladet.dk",
        elementSelector: "#nsqbox",
        fn: function (el) {
            $(el).remove();
            $(".nsqpage").removeClass("nsqpage");
            $(".nsqlayer").remove();
        }});

    antiAdblockMappings.forEach(function(mapping) {
        if (window.location.hostname.indexOf(mapping.site) > -1) {
            var waitUntilLoaded = setInterval(function () {
                if ($(mapping.elementSelector).length > 0) {
                    clearInterval(waitUntilLoaded);

                    if (!mapping.fn) {
                        $(mapping.elementSelector).remove();
                    }

                    if (mapping.fn) {
                        mapping.fn(mapping.elementSelector);
                    }
                }
            }, 100);
        }
    });
});