标题
增加 1 行删除 1 行
1洛谷内容净化器——为您的犇犇使用体验保驾护航!1洛谷内容净化器——为您的洛谷使用体验保驾护航,不仅限于洛谷!
正文
增加 12 行删除 867 行
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876如今,洛谷犇犇惊现一群猫粮与南梁,让人观犇体验骤降且有同化趋势。为预防此类现象,维护洛谷犇犇观看安全,本人使用DeepSeek编写了一个油猴脚本,专门预防此类现象。::::info[脚本代码(更新请关注@ [WJRAK's Article](https://www.luogu.com.cn/user/1695884/article))]```javascript// ==UserScript==// @name 洛谷内容净化器// @namespace http://tampermonkey.net/// @version 5.1// @description 专门屏蔽洛谷一些让人不适的词汇(支持替换和删除)// @author WJRAK&DeepSeek// @match *://*/*// @grant GM_setValue// @grant GM_getValue// @grant GM_registerMenuCommand// @run-at document-end// @license MIT// ==/UserScript==(function() {'use strict';// ========== 核心词库 ==========const CORE_REPLACE_WORDS = ['南梁', '蓝梁', '香香软软', '肉文', '小黄文','猫娘','猫粮'];const CORE_DELETE_WORDS = ['喵'];// ========== 字符映射表(用于生成所有可能的变体)==========// 1. 拼音映射(包括带数字的变体)const PINYIN_MAP = {'南': ['nan', 'na', 'nán', 'nàn', 'na2', 'na4'],'蓝': ['lan', 'la', 'lán', 'làn', 'la2', 'la4'],'梁': ['liang', 'lia', 'lía', 'liàng', 'lia2', 'lia4', 'lian'],'香': ['xiang', 'xia', 'xiāng', 'xiàng', 'xia1', 'xia4'],'软': ['ruan', 'rua', 'ruǎn', 'ruàn', 'rua3', 'rua4'],'肉': ['rou', 'ro', 'ròu', 'ro4'],'文': ['wen', 'we', 'wén', 'wèn', 'we2', 'we4'],'小': ['xiao', 'xia', 'xiǎo', 'xiào', 'xiao3', 'xia3'],'黄': ['huang', 'hua', 'huáng', 'huàng', 'hua2', 'hua4'],'喵': ['miao', 'mia', 'miāo', 'miào', 'miao1', 'miao4'],'猫': ['mao', 'ma', 'māo', 'mào', 'mao1', 'mao4'],'娘': ['niang', 'nia', 'niáng', 'niàng', 'nia2', 'nia4'],'粮': ['liang', 'lia', 'liáng', 'liàng', 'lia2', 'lia4']};// 2. 数字替换字母 (Leet)const LEET_MAP = {'a': '[a4@]','b': '[b8]','c': '[c(]','e': '[e3]','g': '[g9]','i': '[i1!]','l': '[l1|]','o': '[o0]','s': '[s5$]','t': '[t7]','z': '[z2]','n': '[n]','m': '[m]'};// 3. 同音字映射const HOMOPHONE_MAP = {'南': '[南男难喃楠]','蓝': '[蓝篮兰拦栏]','梁': '[梁粮凉粱量]','香': '[香湘乡箱镶]','软': '[软阮蠕]','肉': '[肉褥]','文': '[文纹闻蚊]','小': '[小晓筱]','黄': '[黄皇煌簧]','喵': '[喵]','猫': '[猫锚]','娘': '[娘酿]','粮': '[粮凉梁粱量]'};// 4. 形近字映射const SIMILAR_MAP = {'南': '[南茼]','蓝': '[蓝监]','梁': '[梁染]','香': '[杳杏]','喵': '[喵]','猫': '[猫]','娘': '[娘]','粮': '[粮]'};// ========== 存储键名 ==========const STORAGE_REPLACE_WORDS = 'shield_replace_words';const STORAGE_DELETE_WORDS = 'shield_delete_words';const STORAGE_SETTINGS = 'shield_settings';// ========== 默认设置 ==========const DEFAULT_SETTINGS = {modePinyin: true, // 拼音匹配modeLeet: true, // 数字替换匹配modeHomophone: true, // 同音字匹配modeSimilar: true, // 形近字匹配modeFuzzy: true, // 模糊匹配(中间插字符)modeSplit: true, // 拆分匹配(如"南 梁")maxFuzzyDistance: 3, // 模糊距离logToConsole: false // 输出日志};// ========== 初始化 ==========function initStorage() {if (GM_getValue(STORAGE_REPLACE_WORDS, null) === null) {GM_setValue(STORAGE_REPLACE_WORDS, CORE_REPLACE_WORDS);}if (GM_getValue(STORAGE_DELETE_WORDS, null) === null) {GM_setValue(STORAGE_DELETE_WORDS, CORE_DELETE_WORDS);}if (GM_getValue(STORAGE_SETTINGS, null) === null) {GM_setValue(STORAGE_SETTINGS, DEFAULT_SETTINGS);}}initStorage();// ========== 获取数据 ==========function getReplaceWords() {return GM_getValue(STORAGE_REPLACE_WORDS, []);}function getDeleteWords() {return GM_getValue(STORAGE_DELETE_WORDS, []);}function getSettings() {return GM_getValue(STORAGE_SETTINGS, DEFAULT_SETTINGS);}// ========== 更新 ==========function updateAll(newReplaceWords, newDeleteWords, newSettings) {GM_setValue(STORAGE_REPLACE_WORDS, newReplaceWords);GM_setValue(STORAGE_DELETE_WORDS, newDeleteWords);GM_setValue(STORAGE_SETTINGS, newSettings);processDocument();}// ========== 转义正则 ==========function escapeRegExp(string) {return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');}// ========== 生成拼音变体 ==========function generatePinyinVariants(word) {let variants = [];for (let i = 0; i < word.length; i++) {const char = word[i];const pinyins = PINYIN_MAP[char] || [char];if (variants.length === 0) {variants = [...pinyins];} else {const newVariants = [];variants.forEach(v => {pinyins.forEach(p => {newVariants.push(v + p);});});variants = newVariants;}}return variants;}// ========== 生成Leet模式 ==========function createLeetPattern(text) {let pattern = '';for (let char of text.toLowerCase()) {if (LEET_MAP[char]) {pattern += LEET_MAP[char];} else {pattern += char;}}return pattern;}// ========== 生成单个词的所有模式 ==========function generatePatternsForWord(word, settings) {const patterns = new Set();// 1. 原词patterns.add(escapeRegExp(word));// 2. 拆分匹配if (settings.modeSplit) {patterns.add(word.split('').join('\\s*'));}// 3. 模糊匹配if (settings.modeFuzzy) {const chars = word.split('');patterns.add(chars.join(`[^<>]{0,${settings.maxFuzzyDistance}}`));}// 4. 同音字匹配if (settings.modeHomophone) {let homoPattern = '';for (let char of word) {if (HOMOPHONE_MAP[char]) {homoPattern += HOMOPHONE_MAP[char];} else {homoPattern += char;}}patterns.add(homoPattern);}// 5. 形近字匹配if (settings.modeSimilar) {let similarPattern = '';for (let char of word) {if (SIMILAR_MAP[char]) {similarPattern += SIMILAR_MAP[char];} else {similarPattern += char;}}patterns.add(similarPattern);}// 6. 拼音变体if (settings.modePinyin || settings.modeLeet) {const pinyinVariants = generatePinyinVariants(word);pinyinVariants.forEach(py => {patterns.add(py);if (settings.modeLeet) {patterns.add(createLeetPattern(py));}if (settings.modeSplit) {patterns.add(py.split('').join('\\s*'));}if (settings.modeFuzzy) {const chars = py.split('');patterns.add(chars.join(`[^<>]{0,${settings.maxFuzzyDistance}}`));}});}return Array.from(patterns);}// ========== 构建正则 ==========function buildPatterns(settings) {const replaceWords = getReplaceWords();const deleteWords = getDeleteWords();let replacePatterns = [];let deletePatterns = [];// 生成替换词模式replaceWords.forEach(word => {const patterns = generatePatternsForWord(word, settings);replacePatterns = replacePatterns.concat(patterns);});// 生成删除词模式deleteWords.forEach(word => {const patterns = generatePatternsForWord(word, settings);deletePatterns = deletePatterns.concat(patterns);});// 去重排序replacePatterns = [...new Set(replacePatterns)].sort((a, b) => b.length - a.length);deletePatterns = [...new Set(deletePatterns)].sort((a, b) => b.length - a.length);return {replacePattern: replacePatterns.length > 0 ? new RegExp(replacePatterns.join('|'), 'gi') : null,deletePattern: deletePatterns.length > 0 ? new RegExp(deletePatterns.join('|'), 'gi') : null};}// ========== 测试函数 ==========function testMatching() {const settings = getSettings();const { replacePattern, deletePattern } = buildPatterns(settings);const testCases = [// 替换词测试'南梁', '南[梁', '南-梁', '南 梁', 'nanliang', 'na4nliang', '男梁','蓝梁', '香香软软', '香 香 软 软', 'xiangxiangruanruan','肉文', 'rouwen', 'ro4we2','小黄文', 'xiaohuangwen', 'xiao2huang2wen2',// 删除词测试'喵', '喵喵', 'miaomiao', 'miao', 'mi4o', '喵喵喵', '猫'];console.log('【测试】替换模式:', replacePattern);console.log('【测试】删除模式:', deletePattern);console.log('【测试】匹配结果:');testCases.forEach(test => {let result = '❌';if (replacePattern) {replacePattern.lastIndex = 0;if (replacePattern.test(test)) result = '✅ 替换';}if (deletePattern && result === '❌') {deletePattern.lastIndex = 0;if (deletePattern.test(test)) result = '✅ 删除';}console.log(` "${test}" → ${result}`);});}// ========== 核心处理函数 ==========function processDocument() {const settings = getSettings();const { replacePattern, deletePattern } = buildPatterns(settings);if (!replacePattern && !deletePattern) return;if (settings.logToConsole) {console.log('【内容净化器】启动');}function walk(node) {if (node.nodeType === Node.TEXT_NODE) {if (!node.nodeValue.trim()) return;let text = node.nodeValue;let originalText = text;// 先执行删除(优先级高)if (deletePattern) {text = text.replace(deletePattern, (match) => {if (settings.logToConsole) {console.log('【删除】', match);}return '';});}// 再执行替换if (replacePattern) {text = text.replace(replacePattern, (match) => {if (settings.logToConsole) {console.log('【替换】', match, '→ (已屏蔽)');}return '(已屏蔽)';});}if (text !== originalText) {node.nodeValue = text;}}else if (node.nodeType === Node.ELEMENT_NODE) {if (/^(script|style|textarea|input)$/i.test(node.tagName)) {return;}for (let child of node.childNodes) {walk(child);}}}if (document.body) {walk(document.body);}}// ========== 监听动态内容 ==========function observeMutations() {const observer = new MutationObserver((mutations) => {if (observer.timeout) clearTimeout(observer.timeout);observer.timeout = setTimeout(processDocument, 300);});observer.observe(document.body, {childList: true,subtree: true,characterData: true});}// ========== 创建设置面板 ==========function createSettingsPanel() {if (document.getElementById('gm-settings-panel')) return;let currentReplaceWords = getReplaceWords();let currentDeleteWords = getDeleteWords();let currentSettings = getSettings();// 创建遮罩层const overlay = document.createElement('div');overlay.id = 'gm-settings-overlay';overlay.style.cssText = `position: fixed;top: 0;left: 0;width: 100%;height: 100%;background: rgba(0,0,0,0.5);z-index: 999998;display: none;justify-content: center;align-items: center;`;// 创建面板const panel = document.createElement('div');panel.id = 'gm-settings-panel';panel.style.cssText = `background: white;width: 650px;max-width: 90%;max-height: 85vh;border-radius: 12px;box-shadow: 0 10px 40px rgba(0,0,0,0.3);padding: 24px;font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;color: #333;overflow-y: auto;position: relative;`;// ========== 标题 ==========const title = document.createElement('h2');title.textContent = '🛡️ 洛谷内容净化器';title.style.cssText = `margin: 0 0 16px 0;font-size: 1.5rem;border-bottom: 2px solid #eaeef2;padding-bottom: 8px;`;panel.appendChild(title);// ========== 说明文字 ==========const desc = document.createElement('p');desc.innerHTML = '替换词:南梁、蓝梁、香香软软、肉文、小黄文 → (已屏蔽)<br>删除词:喵 → 直接消失';desc.style.cssText = `font-size: 0.95rem;color: #666;margin-bottom: 20px;padding: 12px;background: #f0f3f5;border-radius: 8px;border-left: 4px solid #c44536;`;panel.appendChild(desc);// ========== 匹配模式设置 ==========const modeContainer = document.createElement('div');modeContainer.style.cssText = `background: #f8f9fa;border-radius: 10px;padding: 18px;margin-bottom: 20px;border: 1px solid #e0e0e0;`;const modeTitle = document.createElement('div');modeTitle.innerHTML = '🔍 <strong>匹配模式</strong>';modeTitle.style.cssText = `margin-bottom: 16px;font-size: 1.1rem;`;modeContainer.appendChild(modeTitle);// 模式列表const modes = [{ id: 'modePinyin', label: '拼音匹配', desc: 'nanliang → 南梁', color: '#2c3e50' },{ id: 'modeLeet', label: '数字替换', desc: 'na4nliang → 南梁', color: '#c44536' },{ id: 'modeHomophone', label: '同音字', desc: '男梁 → 南梁', color: '#27ae60' },{ id: 'modeSimilar', label: '形近字', desc: '蓝监 → 蓝梁', color: '#f39c12' },{ id: 'modeFuzzy', label: '模糊匹配', desc: '南[梁 → 南梁', color: '#8e44ad' },{ id: 'modeSplit', label: '拆分匹配', desc: '南 梁 → 南梁', color: '#16a085' }];const modeGrid = document.createElement('div');modeGrid.style.cssText = `display: grid;grid-template-columns: repeat(2, 1fr);gap: 12px;margin-bottom: 15px;`;modes.forEach(mode => {const card = document.createElement('div');card.style.cssText = `background: white;border-radius: 8px;padding: 12px;border: 1px solid #e0e0e0;`;const row = document.createElement('div');row.style.cssText = `display: flex; align-items: flex-start; gap: 10px;`;const checkbox = document.createElement('input');checkbox.type = 'checkbox';checkbox.id = `mode-${mode.id}`;checkbox.checked = currentSettings[mode.id];checkbox.style.cssText = `width: 18px;height: 18px;margin-top: 2px;cursor: pointer;accent-color: ${mode.color};`;const labelDiv = document.createElement('div');labelDiv.style.flex = '1';const label = document.createElement('label');label.htmlFor = `mode-${mode.id}`;label.innerHTML = `<strong style="color:${mode.color}">${mode.label}</strong>`;label.style.cssText = `display: block; cursor: pointer; font-size: 1rem; margin-bottom: 4px;`;const descSmall = document.createElement('small');descSmall.textContent = mode.desc;descSmall.style.cssText = `color: #666; font-size: 0.8rem; display: block;`;labelDiv.appendChild(label);labelDiv.appendChild(descSmall);row.appendChild(checkbox);row.appendChild(labelDiv);card.appendChild(row);modeGrid.appendChild(card);});modeContainer.appendChild(modeGrid);// 模糊距离设置const distanceRow = document.createElement('div');distanceRow.style.cssText = `margin-top: 15px;padding: 15px;background: white;border-radius: 8px;border: 1px solid #e0e0e0;`;const sliderContainer = document.createElement('div');sliderContainer.style.cssText = `display: flex; align-items: center; gap: 15px;`;const distanceLabel = document.createElement('label');distanceLabel.htmlFor = 'fuzzy-distance';distanceLabel.textContent = '模糊距离:';distanceLabel.style.minWidth = '60px';const distanceInput = document.createElement('input');distanceInput.type = 'range';distanceInput.id = 'fuzzy-distance';distanceInput.min = '1';distanceInput.max = '5';distanceInput.value = currentSettings.maxFuzzyDistance;distanceInput.style.cssText = `flex: 1; height: 6px;`;const distanceValue = document.createElement('span');distanceValue.id = 'fuzzy-distance-value';distanceValue.textContent = currentSettings.maxFuzzyDistance;distanceValue.style.cssText = `min-width: 30px;text-align: center;font-weight: bold;color: #c44536;background: #f0f0f0;padding: 4px 8px;border-radius: 4px;`;distanceInput.oninput = function() {distanceValue.textContent = this.value;};sliderContainer.appendChild(distanceLabel);sliderContainer.appendChild(distanceInput);sliderContainer.appendChild(distanceValue);distanceRow.appendChild(sliderContainer);modeContainer.appendChild(distanceRow);panel.appendChild(modeContainer);// ========== 日志选项 ==========const logContainer = document.createElement('div');logContainer.style.cssText = `background: #f8f9fa;border-radius: 10px;padding: 12px 18px;margin-bottom: 20px;border: 1px solid #e0e0e0;display: flex;align-items: center;`;const logCheckbox = document.createElement('input');logCheckbox.type = 'checkbox';logCheckbox.id = 'log-console';logCheckbox.checked = currentSettings.logToConsole;logCheckbox.style.cssText = `width: 18px; height: 18px; margin-right: 10px; cursor: pointer;`;const logLabel = document.createElement('label');logLabel.htmlFor = 'log-console';logLabel.innerHTML = '<strong>控制台日志</strong> (在F12控制台显示屏蔽记录)';logLabel.style.cursor = 'pointer';logContainer.appendChild(logCheckbox);logContainer.appendChild(logLabel);panel.appendChild(logContainer);// ========== 替换词编辑 ==========const replaceContainer = document.createElement('div');replaceContainer.style.cssText = `background: #f8f9fa;border-radius: 10px;padding: 18px;margin-bottom: 20px;border: 1px solid #e0e0e0;`;const replaceTitle = document.createElement('div');replaceTitle.innerHTML = '<strong>🔴 替换词 (变为"已屏蔽")</strong>';replaceTitle.style.marginBottom = '10px';replaceContainer.appendChild(replaceTitle);const replaceTextarea = document.createElement('textarea');replaceTextarea.value = currentReplaceWords.join('\n');replaceTextarea.placeholder = '每行一个词';replaceTextarea.style.cssText = `width: 100%;box-sizing: border-box;padding: 10px;border: 1px solid #ccc;border-radius: 6px;font-size: 0.95rem;min-height: 100px;resize: vertical;font-family: monospace;`;replaceContainer.appendChild(replaceTextarea);panel.appendChild(replaceContainer);// ========== 删除词编辑 ==========const deleteContainer = document.createElement('div');deleteContainer.style.cssText = `background: #f8f9fa;border-radius: 10px;padding: 18px;margin-bottom: 20px;border: 1px solid #e0e0e0;`;const deleteTitle = document.createElement('div');deleteTitle.innerHTML = '<strong>🗑️ 删除词 (直接消失)</strong>';deleteTitle.style.marginBottom = '10px';deleteContainer.appendChild(deleteTitle);const deleteTextarea = document.createElement('textarea');deleteTextarea.value = currentDeleteWords.join('\n');deleteTextarea.placeholder = '例如:喵';deleteTextarea.style.cssText = `width: 100%;box-sizing: border-box;padding: 10px;border: 1px solid #ccc;border-radius: 6px;font-size: 0.95rem;min-height: 80px;resize: vertical;font-family: monospace;`;deleteContainer.appendChild(deleteTextarea);panel.appendChild(deleteContainer);// ========== 按钮区域 ==========const btnContainer = document.createElement('div');btnContainer.style.cssText = `display: flex;justify-content: flex-end;gap: 12px;margin-top: 10px;padding-top: 10px;border-top: 1px solid #e0e0e0;`;// 测试按钮const testBtn = document.createElement('button');testBtn.innerHTML = '🔍 测试';testBtn.style.cssText = `padding: 8px 16px;border: 1px solid #2c3e50;background: white;color: #2c3e50;border-radius: 6px;cursor: pointer;`;testBtn.onclick = () => {testMatching();alert('测试结果已输出到控制台');};// 取消按钮const cancelBtn = document.createElement('button');cancelBtn.innerHTML = '取消';cancelBtn.style.cssText = `padding: 8px 16px;border: 1px solid #ccc;background: white;border-radius: 6px;cursor: pointer;`;cancelBtn.onclick = () => {overlay.style.display = 'none';};// 保存按钮const saveBtn = document.createElement('button');saveBtn.innerHTML = '保存';saveBtn.style.cssText = `padding: 8px 16px;border: none;background: #2c3e50;color: white;border-radius: 6px;cursor: pointer;font-weight: 500;`;saveBtn.onclick = () => {const newReplaceWords = replaceTextarea.value.split('\n').map(l => l.trim()).filter(l => l);const newDeleteWords = deleteTextarea.value.split('\n').map(l => l.trim()).filter(l => l);const newSettings = {modePinyin: document.getElementById('mode-modePinyin').checked,modeLeet: document.getElementById('mode-modeLeet').checked,modeHomophone: document.getElementById('mode-modeHomophone').checked,modeSimilar: document.getElementById('mode-modeSimilar').checked,modeFuzzy: document.getElementById('mode-modeFuzzy').checked,modeSplit: document.getElementById('mode-modeSplit').checked,maxFuzzyDistance: parseInt(document.getElementById('fuzzy-distance').value),logToConsole: document.getElementById('log-console').checked};updateAll(newReplaceWords, newDeleteWords, newSettings);overlay.style.display = 'none';};btnContainer.appendChild(testBtn);btnContainer.appendChild(cancelBtn);btnContainer.appendChild(saveBtn);panel.appendChild(btnContainer);// 关闭按钮const closeIcon = document.createElement('span');closeIcon.innerHTML = '✕';closeIcon.style.cssText = `position: absolute;top: 18px;right: 24px;font-size: 1.6rem;cursor: pointer;color: #999;`;closeIcon.onclick = () => {overlay.style.display = 'none';};panel.appendChild(closeIcon);overlay.appendChild(panel);document.body.appendChild(overlay);// 触发按钮let triggerBtn = document.getElementById('gm-settings-trigger');if (!triggerBtn) {triggerBtn = document.createElement('div');triggerBtn.id = 'gm-settings-trigger';triggerBtn.innerHTML = '🛡️';triggerBtn.style.cssText = `position: fixed;bottom: 20px;right: 20px;width: 52px;height: 52px;background: #c44536;color: white;border-radius: 50%;display: flex;align-items: center;justify-content: center;font-size: 26px;cursor: pointer;box-shadow: 0 4px 15px rgba(0,0,0,0.3);z-index: 999999;opacity: 0.85;border: 2px solid white;`;triggerBtn.onclick = () => {const curReplace = getReplaceWords();const curDelete = getDeleteWords();const curSettings = getSettings();replaceTextarea.value = curReplace.join('\n');deleteTextarea.value = curDelete.join('\n');document.getElementById('mode-modePinyin').checked = curSettings.modePinyin;document.getElementById('mode-modeLeet').checked = curSettings.modeLeet;document.getElementById('mode-modeHomophone').checked = curSettings.modeHomophone;document.getElementById('mode-modeSimilar').checked = curSettings.modeSimilar;document.getElementById('mode-modeFuzzy').checked = curSettings.modeFuzzy;document.getElementById('mode-modeSplit').checked = curSettings.modeSplit;document.getElementById('fuzzy-distance').value = curSettings.maxFuzzyDistance;document.getElementById('fuzzy-distance-value').textContent = curSettings.maxFuzzyDistance;document.getElementById('log-console').checked = curSettings.logToConsole;overlay.style.display = 'flex';};document.body.appendChild(triggerBtn);}}// ========== 初始化 ==========function init() {processDocument();createSettingsPanel();observeMutations();console.log('【内容净化器】已启动');}if (document.readyState === 'loading') {document.addEventListener('DOMContentLoaded', init);} else {init();}// ========== 菜单命令 ==========GM_registerMenuCommand('测试匹配', testMatching);GM_registerMenuCommand('打开设置', () => {document.getElementById('gm-settings-overlay').style.display = 'flex';});})();```::::::::info[效果]{open}原图1:效果1:原图2:效果2:原图3:效果3:::::::::warning[注意]更新脚本时,请**关闭插件**,否则可能会引发失效等**不应出现**的错误::::123456789101112131415161718192021**由AI辅助完成**如今,洛谷犇犇惊现一群猫粮与南梁,让人观犇体验骤降且有同化趋势。为保(kan)证(qi)犇(lai)犇(bu)观(e)感(xin),本人特意编写了这个脚本以解决相关问题。::::info[脚本代码][最新版](https://www.luogu.me/paste/nz6vxc03)::::::::warning[注意]{open}1. 更新脚本时,请**关闭插件**,否则可能会引发失效等**不应出现**的错误2. 可能会出现误杀等情况,可联系@[WJRAK](https://www.luogu.com.cn/user/1695884)以解决3. 与[洛谷驱猫助手](https://www.luogu.com.cn/article/ora3c5va)同时使用体验更佳。4. 开启高级模式体验更佳!5. 本脚本全浏览器通用哦!::::