Now.gg Ads Remover

Automatically removes specific elements and ads if the website has a specific logo image with comments on code.

当前为 2024-12-10 提交的版本,查看 最新版本

// ==UserScript==
// @name         Now.gg Ads Remover
// @namespace    http://tampermonkey.net/
// @version      0.5
// @description  Automatically removes specific elements and ads if the website has a specific logo image with comments on code.
// @author       UniverseDev
// @license      GPL-3.0-or-later
// @match        *://*/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Selectors for elements to be removed
    const elementSelector = 'div.sc-19c21da7-0.dgAMyI';
    const adContainerSelector = 'div#div-ad-app-page-leaderboard-container';

    // Function to remove the targeted elements
    function removeElements() {
        // Remove specific content elements
        var elements = document.querySelectorAll(elementSelector);
        elements.forEach(function(el) {
            el.remove();
        });

        // Remove ad container
        var adContainer = document.querySelector(adContainerSelector);
        if (adContainer) {
            adContainer.remove();
        }
    }

    // Function to check for the specific image
    function checkForLogoAndRun() {
        let logoImg = document.querySelector('img#ng-logo.ngg-logo');
        if (logoImg && logoImg.src.includes("nowgg-logo.2eda3eaf.svg")) {
            // If the specific logo image is found, run the removeElements function
            removeElements();
        }
    }

    // Run the check as soon as the DOM is fully loaded
    window.addEventListener('load', checkForLogoAndRun);

})();

QingJ © 2025

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