Greasy Fork

Greasy Fork is available in English.

Basic chat filter bypass

Useless script to bypass some chat filters.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Basic chat filter bypass
// @namespace    http://tampermonkey.net/
// @version      1.0.0
// @description  Useless script to bypass some chat filters.
// @author       ;-;
// @match        https://arras.io/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    const zeroWidthSpace = '\u200B';
    let lastKeyTyped = '';
    let lastKeyLower = '';

    const bypassPairs = [
        ['e', 'z'],
        ['i', 'g'],
        ['u', 'c'],
        ['h', 'i'],
        ['s', 's'],
        ['i', 'c'],
        ['u', 's'],
        ['u', 'n'],
        ['a', 'p'],
        ['o', 'c'],
        ['b', 'i'],
        ['u', 't'],
        ['a', 'g'],
        ['t', 'f'],
        ['y', 's'],
        ['e', 'g']
    ];

    document.addEventListener('keydown', function (e) {
        const input = e.target;
        if (!input || (input.tagName !== 'INPUT' && input.tagName !== 'TEXTAREA')) return;

        const currentKey = e.key;
        const currentKeyLower = currentKey.toLowerCase();
        const pos = input.selectionStart;
        const val = input.value;

        if (lastKeyTyped === ' ' && currentKey === '$') {
            e.preventDefault();
            const before = val.slice(0, pos - 1);
            const after = val.slice(pos);
            input.value = before + ' ' + zeroWidthSpace + '$' + after;
        input.setSelectionRange(pos + 2, pos + 2);
        }

        for (const [first, second] of bypassPairs) {
            if (lastKeyLower === first && currentKeyLower === second) {
                e.preventDefault();
                const before = val.slice(0, pos - 1);
                const after = val.slice(pos);
                input.value = before + lastKeyTyped + zeroWidthSpace + currentKey + after;
                input.setSelectionRange(pos + 2, pos + 2);
                break;
            }
        }

        if (!['Shift', 'Control', 'Alt', 'Meta'].includes(currentKey)) {
            lastKeyTyped = currentKey;
            lastKeyLower = currentKeyLower;
        }
    });
})();