HideAdForWuhaolin

hide ad in webpack.wuhaolin.cn

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         HideAdForWuhaolin
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  hide ad in webpack.wuhaolin.cn
// @author       Roastwind
// @match        https://webpack.wuhaolin.cn/*
// @grant        none
// ==/UserScript==

(function() {
'use strict';
var ready = function(callback) {
    var href = window.location.href
    var isWuhaolin = /^https?:\/\/webpack\.wuhaolin.cn/.test(href)
    if (!isWuhaolin) return
    var timer = setInterval(function() {
        var ad = document.querySelector('.gitbook-plugin-modal')
        var style = ad.style
        // add && style.display === 'block'
        if (ad) {
            clearInterval(timer)
            callback && callback()
        }
    }, 100)
}

ready(function() {
    init()
})

var init = function () {
    // hideAd()
    var style = document.createElement('style')
    style.textContent = '.gitbook-plugin-modal { display: none !important; }'
    document.getElementsByTagName('head')[0].appendChild(style)
}

var hideAd = function () {
    var ad = document.querySelector('.gitbook-plugin-modal')
    // https://www.cnblogs.com/LiuWeiLong/p/6058059.html
    ad.style.setProperty('display', 'none', 'important')
}

})();