自用去广告插件

去广告

目前为 2024-06-29 提交的版本。查看 最新版本

// ==UserScript==
// @name        自用去广告插件
// @namespace   http://tampermonkey.net/
// @match       https://applnn.cc/
// @match       https://applnn.cc/*
// @match       https://www.applnn.cc/
// @match       https://www.applnn.cc/*
// @grant       unsafeWindow
// @grant       GM_addStyle
// @run-at      document-start
// @version     1.2
// @license     MIT
// @author      Berger
// @description 去广告
// ==/UserScript==

(function () {
    'use strict';

    function app_lnn_AD_normal() {
        const noticeBoard = document.querySelector('div[id="gong-box"]');
        if (noticeBoard) {
            noticeBoard.remove()
        }
        const homeTopAd_1 = document.querySelector('div[id="home-row-dhsj"]');
        if (homeTopAd_1) {
            homeTopAd_1.remove()
        }
        const homeTopAd_2 = document.querySelector('div[id="home-row-gd1"]');
        if (homeTopAd_2) {
            homeTopAd_2.remove()
        }

        const singleTopAd = document.querySelector('div[class="single-top-html"]');
        if (singleTopAd) {
            singleTopAd.remove()
        }
    }

    function app_lnn_AD_special() {
        // const iframes = document.querySelector('iframe:not([src])');
        // console.log(iframes)
        // if (iframes) {
        //     iframes.style.setProperty('visibility', 'hidden', 'important');
        // }

        GM_addStyle('iframe:not([src]){visibility:hidden !important}');
    }


    let main = {
        initNormal() {
            app_lnn_AD_normal()
        },

        initSpecial() {
            app_lnn_AD_special()
        }
    }

    window.addEventListener('DOMContentLoaded', main.initNormal);
    window.addEventListener('load', main.initSpecial);
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址