[Recommended] Roblox's cleanest designed game filter

Automatically filters and removes roblox games containing certain phrases or words. (By default is set to RNG game's)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        [Recommended] Roblox's cleanest designed game filter
// @namespace   Made for fun, thought people would like it, so here ya go :D
// @license GNU GPLv3
// @match       *://*.roblox.com/*
// @grant       none
// @version     2.0
// @author      Lexi the elf (greasy fork)
// @description Automatically filters and removes roblox games containing certain phrases or words. (By default is set to RNG game's)
// ==/UserScript==

(function() {
    'use strict';


    function replaceElements() {
        const targetStrings = ["RNG"];
        const selector = targetStrings.map(str => `img[alt*="${str}" i], img[title*="${str}" i]`).join(',');
        const elements = document.querySelectorAll(selector);
        elements.forEach(img => {
            const aParent = img.closest('a.game-card-link');
            if (aParent) {
                const replacementHTML = `
                    <a class="game-card-link" href="https://www.roblox.com/games/refer?PlaceId=15854820298&amp;Position=1&amp;PageType=Profile">
                        <div class="featured-game-icon-container">
                            <span class="thumbnail-2d-container brief-game-icon">
                                <img class="" src="https://tr.rbxcdn.com/5c89de1a6d50e50f4bb3ffb104a0d595/768/432/Image/Png" alt="content removed" title="content removed">
                            </span>
                        </div>
                        <div class="info-container">
                            <div class="game-card-name game-name-title" title="removed">404 Game Not found</div>
                            <div class="wide-game-tile-metadata">
                                <div class="base-metadata">
                                    <div class="game-card-info" data-testid="game-tile-stats-rating">
                                        <span class="info-label icon-votes-gray"></span>
                                        <span class="info-label vote-percentage-label">removed by script</span>
                                    </div>
                                </div>
                                <div class="hover-metadata"></div>
                            </div>
                        </div>
                    </a>
                `;
                const replacementNode = new DOMParser().parseFromString(replacementHTML, 'text/html').body.firstChild;
                aParent.parentNode.replaceChild(replacementNode, aParent);
            }
        });
    }

    setInterval(replaceElements, 20);
})();