Greasy Fork

Remove Ad Card and Overlay

Remove the ad card and overlay automatically when the page loads.

目前为 2025-01-26 提交的版本。查看 最新版本

// ==UserScript==
// @name         Remove Ad Card and Overlay
// @namespace    https://greasyfork.org/en/users/1427435-fevnax
// @version      1
// @description  Remove the ad card and overlay automatically when the page loads.
// @author       Harsh P
// @match        https://asuracomic.net/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    const interval = setInterval(() => {
        const adCard = document.querySelector('.bg-gradient-to-br.from-indigo-900.via-purple-900.to-indigo-800.p-6');
        const overlay = document.querySelector('.fixed.inset-0.bg-gray-900.bg-opacity-75.flex.items-center.justify-center.z-50.p-4');

        if (adCard) {
            adCard.remove(); 
            console.log('Ad card successfully removed.');
        }

        if (overlay) {
            overlay.remove();
            console.log('Overlay successfully removed.');
        }

        if (adCard && overlay) {
            clearInterval(interval);
        }
    }, 500);

    setTimeout(() => clearInterval(interval), 10000);
})();