Greasy Fork

Greasy Fork is available in English.

Asura - Advert Remover

Removes the advert overlay, premium card, subscription prompts, and additional ads automatically when the page loads.

当前为 2025-01-29 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Asura - Advert Remover
// @namespace    http://greasyfork.icu/en/users/1427435-fevnax
// @version      1.2
// @description  Removes the advert overlay, premium card, subscription prompts, and additional ads automatically when the page loads.
// @author       Harsh P
// @match        https://asuracomic.net/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    function removeAdvert() {
        var advert = document.querySelector('.fixed.inset-0.bg-gray-900.bg-opacity-75.flex.items-center.justify-center.z-50.p-4');
        if (advert) {
            advert.remove();
            console.log("Advert removed.");
        }
    }

    removeAdvert();

    var observer = new MutationObserver(removeAdvert);
    observer.observe(document.body, { childList: true, subtree: true });

    setTimeout(() => {
        const interval = setInterval(() => {
            try {
                const subHeader = document.querySelector('.bg-gradient-to-br.from-indigo-900.via-purple-900.to-indigo-800.text-white.py-8.px-4.md\\:py-12.md\\:px-10.shadow-lg.relative.overflow-hidden');
                const sub = document.querySelector('.w-full.flex.justify-center');

                console.log('Subscriber Header found:', subHeader);
                console.log('Subscribe Button found:', sub);

                if (subHeader) {
                    subHeader.remove();
                    console.log('Subscriber Header successfully removed.');
                }

                if (sub) {
                    sub.remove();
                    console.log('Subscribe Button successfully removed.');
                }

                if (!subHeader && !sub) {
                    clearInterval(interval);
                    console.log('All targeted elements removed. Stopping script.');
                }

            } catch (error) {
                console.error("Error encountered while removing elements:", error);
            }
        }, 500);

        setTimeout(() => {
            clearInterval(interval);
            console.log('Timeout reached. Stopping script.');
        }, 5000);

    }, 10);
})();