Greasy Fork

Greasy Fork is available in English.

屏蔽果核剥壳广告提示

屏蔽www.ghxi.com网站底部广告被屏蔽提示

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         屏蔽果核剥壳广告提示
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  屏蔽www.ghxi.com网站底部广告被屏蔽提示
// @author       实用脚本
// @match        *://www.ghxi.com/*
// @grant        none
// @run-at       document-start
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    
    // 方法1:CSS隐藏法(立即生效)
    const style = document.createElement('style');
    style.textContent = `
        div[style*="position: fixed;bottom: 0"][style*="background-color: #cc4444"] {
            display: none !important;
            visibility: hidden !important;
            opacity: 0 !important;
            pointer-events: none !important;
        }
    `;
    document.head.appendChild(style);
    
    // 方法2:DOM拦截法(防止动态加载)
    const observer = new MutationObserver((mutations) => {
        mutations.forEach((mutation) => {
            mutation.addedNodes.forEach((node) => {
                if (node.nodeType === 1 && node.style && 
                    node.style.cssText.includes('position: fixed') && 
                    node.style.cssText.includes('bottom: 0') &&
                    node.style.cssText.includes('background-color: #cc4444')) {
                    node.remove();
                }
            });
        });
    });
    
    observer.observe(document.body, {
        childList: true,
        subtree: true
    });
    
    // 方法3:定时检查(兜底方案)
    setInterval(() => {
        document.querySelectorAll('div[style*="position: fixed;bottom: 0"]').forEach(div => {
            if (div.style.cssText.includes('background-color: #cc4444')) {
                div.remove();
            }
        });
    }, 2000);
})();