跳转到内容

User:Bluedeck/serve/blib-ad-blocker.js

维基百科,自由的百科全书
注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google ChromeFirefoxMicrosoft EdgeSafari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。
if(!("bluedeck" in window)) window.bluedeck = {};
if(!("external_config" in window.bluedeck)) window.bluedeck.external_config = {};

window.bluedeck.external_config["blib-ad-blocker"] = {action:"proc1"};
(function(){
    if("remove dom bluedeck_dom_98d469b20b0bb4cd715ef839223c8f00 so as to unclutter ads for people who already have the plug-in"){
        var dom_idcn = "bluedeck_dom_98d469b20b0bb4cd715ef839223c8f00";
        var a = Array.from(document.getElementsByClassName(dom_idcn));
        var proc1 = x=>(x.style.display="none",x);
        var proc2 = x=>(x.style.opacity="0.4",x);
        if("bluedeck" in window && "external_config" in window.bluedeck && "blib-ad-blocker" in window.bluedeck.external_config) {
            switch(window.bluedeck.external_config["blib-ad-blocker"]["action"]) {
                case "proc2":
                    a.map(proc2);
                default:
                    a.map(proc1);
            }
        }
        else {
            a.map(proc1);
        }
    }
})();