Greasy Fork

来自缓存

Greasy Fork is available in English.

HostLoc-zsbd+替换敏感字符

HostLoc使用的zsbd+替换敏感字符

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         HostLoc-zsbd+替换敏感字符
// @namespace    https://haoduck.com/
// @version      0.0.1
// @description  HostLoc使用的zsbd+替换敏感字符
// @author       hostloc-嗷嗷
// @match        https://www.hostloc.com/thread-*
// @match        https://www.hostloc.com/forum.php?mod=viewthread*
// @match        https://hostloc.com/thread-*
// @match        https://hostloc.com/forum.php?mod=viewthread*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var l = 20;
    var idioms = ["\n\n\n\u200b\u200b\u200b\u200b\u200b\u200b\u200b"];

    //text1和text2一一对应
    var text1 = ["嫖","屁股","躲猫猫","和谐","小姐姐"];
    var text2 = ["女票","辟谷","duo猫猫","河蟹","小jiejie"];

    function addIdioms() {
        var text=document.getElementById("fastpostmessage");
        for(var j = 0,len=text1.length; j < len; j++) {
            text.value = text.value.replace(new RegExp(text1[j],'g'),text2[j]);
        };
        if (text.value.length<l) {
            text.value += idioms[Math.floor(Math.random()*idioms.length)];
        }
    }
    document.getElementById("fastpostmessage").onkeydown=function(event) {
        if (event.ctrlKey && event.keyCode == 13 || event.altKey && event.keyCode == 83) {
            addIdioms();
            seditor_ctlent(event, 'fastpostvalidate($(\'fastpostform\'))');
        }
    };
    document.getElementById("fastpostsubmit").addEventListener("click", addIdioms);
})();