AGE动漫 去广告优化

移除广告、优化显示内容

当前为 2025-03-08 提交的版本,查看 最新版本

// ==UserScript==
// @name         AGE动漫 去广告优化
// @icon         https://acgwy.cc/wp-content/uploads/2023/01/1c5a0-www.agemys.net.png
// @namespace    http://github.com/Emokui/Sukuna
// @version      1.3
// @description  移除广告、优化显示内容
// @author       Musashi
// @match        https://www.agedm.org/*
// @match        https://web.agespa-01.com:8443/*
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';

    const selectors = [
        'div.global_notice_box',
        'div.global_notice_wrapper',
        'a.nav-download-link[href="https://www.agedm.app?ref=www.agedm.org"]',
        'div.container.xcontainer.py-2',
        'div.text_list_box.links',
        'div.foot_content_wrapper.pb-3',
        'div.van-cell__title',
        'div.bd.van-hairline--bottom'
    ];

    function removeElements() {
        selectors.forEach(selector => {
            document.querySelectorAll(selector).forEach(el => {
                if (selector === 'div.van-cell__title') {
                    if (el.innerHTML.includes("澳门威尼斯人") && el.innerHTML.includes("396.com")) {
                        el.remove();
                    }
                } else {
                    el.remove();
                }
            });
        });

        document.querySelectorAll('img').forEach(img => {
            const src = img.src;
            if (src.includes('xcdn.rltdxt.com') ||
                src.includes('g52j7.com') ||
                src.includes('p3.toutiaoimg.com') ||
                src.includes('p1.bdxiguaimg.com/origin/1386b0000fc487ec8b2ec')) {
                img.remove();
            }
        });
    }

    function observeDOMChanges() {
        const observer = new MutationObserver(() => {
            removeElements();
        });

        const targetNode = document.body || document.documentElement;
        if (targetNode) {
            observer.observe(targetNode, { childList: true, subtree: true });
        }
    }

    if (document.body) {
        removeElements();
        observeDOMChanges();
    } else {
        document.addEventListener("DOMContentLoaded", () => {
            removeElements();
            observeDOMChanges();
        });
    }
})();

QingJ © 2025

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