Greasy Fork

Greasy Fork is available in English.

屏蔽 DBD-Raws

a simple script to block the display of DBD-Raws

当前为 2023-04-15 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        屏蔽 DBD-Raws
// @namespace   anti-DBD-Raws
// @version     0.94
// @description a simple script to block the display of DBD-Raws
// @author      CropCircle
// @match       http://*/*
// @match       https://*/*
// @grant       none
// @run-at      document-idle
// @exclude     https://*.google.*
// @exclude     https://*.bing.*
// @exclude     https://*.baidu.*
// @exclude     http://greasyfork.icu/*
// @license     MIT
// ==/UserScript==

(function() {
    'use strict';

    // Define the keywords to filter and replace
    const keywords = [
        '黑暗路基艾尔',
        'DBD-Raws',
        'DBD分流Q群',
        'DBD',
        'https://afdian.net/@112127luji',
        '746546998',
        '560823326',
        '1158412873',
        '1040411052',
        'https://space.bilibili.com/97177229',
        'https://space.bilibili.com/476857955',
        '神圣之路基艾尔'
    ];
    const replacement = '██视力保护██';
    //const replacenum = '██视力保护██';
    // Loop through all the text nodes on the page
    function traverse(node) {
        let child, next;
        switch (node.nodeType) {
            case 1: // Element
            case 9: // Document
            case 11: // Document fragment
                child = node.firstChild;
                while (child) {
                    next = child.nextSibling;
                    traverse(child);
                    child = next;
                }
                break;
            case 3: // Text node
                if (keywords.some((keyword) => node.nodeValue.match(keyword))) {
                    node.nodeValue = node.nodeValue.replace(new RegExp(keywords.join('|'), 'g'), replacement);
                }
                break;
        }
    }
    traverse(document.body);
})();