dstu

remove baidu ads

Versão de: 01/01/2019. Veja: a última versão.

// ==UserScript==
// @name         dstu
// @namespace    http://tampermonkey.net/
// @version      0.9
// @description  remove baidu ads
// @author       babybing666
// @match        https://d.stulip.org
// @grant        none
// ==/UserScript==
var timeout = 1000;
(function() {
    'use strict';
    var currentURL = window.location.href;
    var dstu = /dstu/;
    var stulip = /stulip/;
    if(dstu.test(currentURL)){
        setTimeout(function () {
            if ((document !== null) && document.hasOwnProperty('sidebar1')) {
            document.getElementById("sidebar1").remove();
            };
            console.log("removed");
        }, timeout);
    } else if (stulip.test(currentURL)){
        setTimeout(function () {
            document.getElementById("cate").remove();
            document.getElementById("coolsite").remove();
            document.getElementById("keywords").remove();
            document.getElementById("banner").remove();
            console.log("removed");
        }, timeout);
    }
})();