adblock_auto icon indicating copy to clipboard operation
adblock_auto copied to clipboard

一个图集网站的广告()

Open daybreak1929 opened this issue 8 months ago • 2 comments

网址

https://yrsdu.xxtt.ink/

补充说明

普通css规则屏蔽不掉,来求助看看XD

你使用的是那个规则?

混合规则精简版

使用的拦截器

Via

User-Agent 信息(可选)

Mozilla/5.0 (Linux; Android 14; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Mobile Safari/537.36

daybreak1929 avatar Apr 18 '25 12:04 daybreak1929

  • 好的,这个网站我写过规则,应该是Via注入的问题,~~用X浏览是能拦截的~~,好吧,X浏览器好像也寄了😂,也许你可以试试用脚本去除。
4khd.com,cartoon18.com,xxtt.ink##.exo_wrapper
4khd.com,docer.com,eol.cn,fapnado.com,firefoxchina.cn,site.baidu.com,xxtt.ink,young-sexy.com##.popup
4khd.com,xxtt.ink##.centbtd
4khd.com,xxtt.ink##.exo-native-widget
4khd.com,xxtt.ink##.exo-native-widget-outer-container
4khd.com,xxtt.ink##ins[data-processed="true"]
4khd.com,xxtt.ink##script[src^="//a.pemsrv.com"] + div
||pemsrv.com^

lingeringsound avatar Apr 18 '25 12:04 lingeringsound

这网站确实离谱,Via这边好像不能拦截网络请求,Css文件也没法注入(T▽T),真流氓啊,根据大佬的规则,用AI转换的脚本确实可以拦截。

// ==UserScript==
// @name         4khd 广告屏蔽
// @namespace    https://viayoo.com
// @version      0.1
// @description  移除4khd.com和xxtt.ink上的广告和弹窗
// @author       Via
// @match        *://*.4khd.com/*
// @match        *://*.xxtt.ink/*
// @run-at       document-end
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    const selectors = [
        '.exo_wrapper',
        '.popup',
        '.centbtd',
        '.exo-native-widget',
        '.exo-native-widget-outer-container',
        'ins[data-processed="true"]'
    ].join(',');

    const targetDomains = /4khd\.com|xxtt\.ink/;
    if (targetDomains.test(window.location.hostname)) {
        const removeElements = () => document.querySelectorAll(selectors).forEach(el => el.remove());
        removeElements();
        new MutationObserver(removeElements).observe(document.body, {
            childList: true,
            subtree: true
        });


        if (window.location.hostname.includes('4khd.com')) {
            const blockPatterns = [
                /magsrv\.com/,
                /\.(js|xmlhttprequest)$/
            ];

            // 拦截并阻止网络请求
            const originalFetch = window.fetch;
            window.fetch = async function(...args) {
                const url = args[0];
                if (blockPatterns.some(pattern => pattern.test(url))) {
                    return new Response('', {
                        status: 200
                    }); // 返回空响应
                }
                return originalFetch.apply(this, args);
            };

            new MutationObserver((mutations) => {
                mutations.forEach(mutation => {
                    mutation.addedNodes.forEach(node => {
                        if (node.tagName === 'SCRIPT' && blockPatterns[0].test(node.src)) {
                            node.remove();
                        }
                    });
                });
            }).observe(document, {
                childList: true,
                subtree: true
            });
        }
    }
})();

Aloazny avatar Apr 19 '25 04:04 Aloazny

这网站确实离谱,Via这边好像不能拦截网络请求,Css文件也没法注入(T▽T),真流氓啊,根据大佬的规则,用AI转换的脚本确实可以拦截。

// ==UserScript== // @name 4khd 广告屏蔽 // @namespace https://viayoo.com // @version 0.1 // @description 移除4khd.com和xxtt.ink上的广告和弹窗 // @author Via // @match ://.4khd.com/* // @match ://.xxtt.ink/* // @run-at document-end // @grant none // ==/UserScript==

(function() { 'use strict'; const selectors = [ '.exo_wrapper', '.popup', '.centbtd', '.exo-native-widget', '.exo-native-widget-outer-container', 'ins[data-processed="true"]' ].join(',');

const targetDomains = /4khd\.com|xxtt\.ink/;
if (targetDomains.test(window.location.hostname)) {
    const removeElements = () => document.querySelectorAll(selectors).forEach(el => el.remove());
    removeElements();
    new MutationObserver(removeElements).observe(document.body, {
        childList: true,
        subtree: true
    });


    if (window.location.hostname.includes('4khd.com')) {
        const blockPatterns = [
            /magsrv\.com/,
            /\.(js|xmlhttprequest)$/
        ];

        // 拦截并阻止网络请求
        const originalFetch = window.fetch;
        window.fetch = async function(...args) {
            const url = args[0];
            if (blockPatterns.some(pattern => pattern.test(url))) {
                return new Response('', {
                    status: 200
                }); // 返回空响应
            }
            return originalFetch.apply(this, args);
        };

        new MutationObserver((mutations) => {
            mutations.forEach(mutation => {
                mutation.addedNodes.forEach(node => {
                    if (node.tagName === 'SCRIPT' && blockPatterns[0].test(node.src)) {
                        node.remove();
                    }
                });
            });
        }).observe(document, {
            childList: true,
            subtree: true
        });
    }
}

})();

  • 不好意思占用了一下回复,如果大佬介意,我会删除的。
  • 写了一个脚本上传到scriptcat了,Via和X浏览器可以先用这个脚本拦截
  • 点击安装

Aloazny avatar Oct 24 '25 04:10 Aloazny

这网站确实离谱,Via这边好像不能拦截网络请求,Css文件也没法注入(T▽T),真流氓啊,根据大佬的规则,用AI转换的脚本确实可以拦截。 // ==UserScript== // @name 4khd 广告屏蔽 // @namespace https://viayoo.com // @Version 0.1 // @description 移除4khd.com和xxtt.ink上的广告和弹窗 // @author Via // @match ://.4khd.com/* // @match ://.xxtt.ink/* // @run-at document-end // @grant none // ==/UserScript== (function() { 'use strict'; const selectors = [ '.exo_wrapper', '.popup', '.centbtd', '.exo-native-widget', '.exo-native-widget-outer-container', 'ins[data-processed="true"]' ].join(',');

const targetDomains = /4khd\.com|xxtt\.ink/;
if (targetDomains.test(window.location.hostname)) {
    const removeElements = () => document.querySelectorAll(selectors).forEach(el => el.remove());
    removeElements();
    new MutationObserver(removeElements).observe(document.body, {
        childList: true,
        subtree: true
    });


    if (window.location.hostname.includes('4khd.com')) {
        const blockPatterns = [
            /magsrv\.com/,
            /\.(js|xmlhttprequest)$/
        ];

        // 拦截并阻止网络请求
        const originalFetch = window.fetch;
        window.fetch = async function(...args) {
            const url = args[0];
            if (blockPatterns.some(pattern => pattern.test(url))) {
                return new Response('', {
                    status: 200
                }); // 返回空响应
            }
            return originalFetch.apply(this, args);
        };

        new MutationObserver((mutations) => {
            mutations.forEach(mutation => {
                mutation.addedNodes.forEach(node => {
                    if (node.tagName === 'SCRIPT' && blockPatterns[0].test(node.src)) {
                        node.remove();
                    }
                });
            });
        }).observe(document, {
            childList: true,
            subtree: true
        });
    }
}

})();

* 不好意思占用了一下回复,如果大佬介意,我会删除的。

* 写了一个[脚本](https://scriptcat.org/zh-CN/script-show-page/4484)上传到`scriptcat`了,**Via和X浏览器可以先用这个脚本拦截**。

* [点击安装](https://scriptcat.org/scripts/code/4484/4khd%20%E5%B9%BF%E5%91%8A%E5%B1%8F%E8%94%BD.user.js)
  • 没事,有解决的方案就行。

lingeringsound avatar Oct 24 '25 07:10 lingeringsound