Greasy Fork 还支持 简体中文。

AGE动漫

优化显示内容

Від 25.02.2025. Дивіться остання версія.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(У мене вже є менеджер скриптів, дайте мені встановити його!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==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.2
// @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'
    ];

    function removeElements() {
        selectors.forEach(selector => {
            const elements = document.querySelectorAll(selector);
            if (elements.length) {
                elements.forEach(el => 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();
        });
    }
})();