srbinas / Unblocking Golem.de & co.

// ==UserScript==
// @name         Unblocking Golem.de & co.
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Adblock-Overlay unblocker for golem.de and co.
// @author       srbinas
// @match        *://*/*
// ==/UserScript==

class BaseUnblocker {
    constructor(_location) {
        if (location.hostname.indexOf(_location) > -1) {
            this.canRun = true;
        }
    }
}

class GolemUnblocker extends BaseUnblocker {
    constructor(_location) {
        super(_location);
    }
    run(callback) {
        if (this.canRun && typeof(callback) === "function") {
            callback();
        }
    }
}

if (window.top === window.self) {
    new GolemUnblocker("golem.de").run(() => {
        let id = setInterval(() => {
            let article = document.querySelector("#screen article");
            let adblock = document.querySelector(".formatted > .dh1.head5");
            
            if (!article || !adblock) {
                return;
            }
            article.style.setProperty("-webkit-filter", null);
            article.style.setProperty("pointer-events", null);
            article.style.setProperty("position", null);
            article.style.setProperty("absolute", null);
            adblock.parentElement.style.display = "none";
            
            console.log("Unblocked!");
            
            clearInterval(id);
        }, 20);
    });
}