Greasy Fork

Greasy Fork is available in English.

Remove annoying ads - Asura

Remove the ad card, overlay, premium card, and additional ads automatically when the page loads.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Remove annoying ads - Asura
// @namespace    http://greasyfork.icu/en/users/1427435-fevnax
// @version      1.1
// @description  Remove the ad card, overlay, premium card, and additional ads automatically when the page loads.
// @author       Harsh P
// @match        https://asuracomic.net/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    setTimeout(() => {
        const interval = setInterval(() => {
            try {
                const advert = document.querySelector('.fixed.inset-0.bg-gray-900.bg-opacity-75.flex.items-center.justify-center.z-50.p-4');
                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('Advert found:', advert);
                console.log('Subscriber Header found:', subHeader);
                console.log('Subscribe Button found:', sub);

                if (advert) {
                    advert.remove();
                    console.log('Advert successfully removed.');
                }

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

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

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

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

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

    }, 3000);

})();