A-A+

利用油猴屏蔽appnee.com广告

2025年11月12日 15:42 学习笔记 暂无评论 共2143字 (阅读155 views次)
Image

【注意:此文章为博主原创文章!转载需注意,请带原文链接,至少也要是txt格式!】

// ==UserScript==
// @name         Hide aao_overlay on appnee.com
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  在访问 appnee.com 时延迟隐藏 aao_overlay 元素
// @author       你自己
// @match        *://appnee.com/*
// @match        *://www.appnee.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    // 延迟 2 秒执行
    setTimeout(function() {
        let overlay = document.getElementById('aao_overlay');
        if (overlay) {
            overlay.style.display = 'none';
            console.log('aao_overlay 已隐藏');
        } else {
            console.log('未找到 aao_overlay 元素');
        }
    }, 2000);
})();

使用说明
打开浏览器并安装 Tampermonkey 扩展。
在 Tampermonkey 中选择 新增脚本。
将上述代码粘贴进去并保存。
访问 https://appnee.com 或 https://www.appnee.com,脚本会自动运行。

或者使用这个也可以

// ==UserScript==
// @name         Hide aao_overlay after DOM ready on appnee.com
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  DOM加载完成后隐藏 aao_overlay 元素
// @author       你自己
// @match        *://appnee.com/*
// @match        *://www.appnee.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    document.addEventListener('DOMContentLoaded', function() {
        let overlay = document.getElementById('aao_overlay');
        if (overlay) {
            overlay.style.display = 'none';
            console.log('aao_overlay 已隐藏(DOM加载完成后执行)');
        } else {
            console.log('DOM加载完成,但未找到 aao_overlay 元素');
        }
    });
})();

DOMContentLoaded:在 HTML 解析完成后(DOM 树构建完成)立即运行,不必等待图片、样式等资源。
更加快速地隐藏 aao_overlay 元素。
如果元素不存在,会在浏览器控制台提示信息。

 

还有一个屏蔽广告的脚本,也可以给大家参考一下

 

// ==UserScript==
// @name         Block Protection and Ads
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Block protection element on ai18.pics and popup-box-ads on all websites
// @author       You
// @match        https://ai18.pics/*
// @match        *://*/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Function to hide protection element on ai18.pics when page is loaded
    if (window.location.hostname === "ai18.pics") {
        window.addEventListener('load', function() {
            const protectionElement = document.getElementById('protection');
            if (protectionElement) {
                protectionElement.style.display = 'none';
            }
        });
    }

    // Function to hide any element with class 'popup-box-ads' on any website
    const hidePopupAds = () => {
        const popupAds = document.querySelectorAll('div.popup-box-ads');
        popupAds.forEach(ad => {
            ad.style.display = 'none';
        });
    };

    // Run hidePopupAds on page load
    window.addEventListener('load', hidePopupAds);

    // Also run hidePopupAds periodically in case new ads load after the initial page load
    setInterval(hidePopupAds, 5000);
})();

布施恩德可便相知重

微信扫一扫打赏

Image

支付宝扫一扫打赏

Image
×
Image

给我留言

Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image Image