首页
文章导航
留言板
友链
更多
关于
推荐
wszx博客
Search
1
免费二级域名,包括可托管到cf的二级域名
8 阅读
2
serv00注册等系列教程,服务器清理,ssh连接不上问题轻松解决,非挂代理
8 阅读
3
使用cloudflare搭建永久免费Trojan节点,免费创建自定义域名,多个节点,无需手动优选,免费无门槛搭建
4 阅读
4
Windows11(24H2 LTSC) 下载方式,这里我提供了2个,建议大家选择官方下载
3 阅读
5
使用油猴插件进行关键词屏蔽
2 阅读
默认
日常
学习
技术
登录
Search
标签搜索
安装
cloudflare
白嫖
脚本
CF
壁纸
图片
docker
Linux
Caddy
代码
哪吒
域名
节点
桌面壁纸
手机壁纸
NAT
LXC
优选
HTML
ws01
累计撰写
108
篇文章
累计收到
60
条评论
首页
栏目
默认
日常
学习
技术
页面
文章导航
留言板
友链
关于
推荐
wszx博客
搜索到
1
篇与
的结果
2024-10-17
使用油猴插件进行关键词屏蔽
使用油猴插件进行关键词屏蔽 本文转载自:https://www.nodeseek.com/post-109394-1关键词列表【关键词仅为个人主观添加,具体自己增删】viie,tuan,跑路云,bestvm,富婆,台妹,usercloud,wise,ocbc,giffgaff,京东,esim,redotpay,batvm,电话卡,虚拟卡,dv,尼区,epic,nnr,庆余年,88vip,bagevm,8v,1v,32v,host-c,尼日利亚,绿云,follow,Yxvm改良版 相较于原版的区别是关键词不区分大小写,注释掉了帖子内容和楼层的关键词屏蔽,只根据标题屏蔽,你也可以取消注释。// ==UserScript== // @name nodeseek论坛屏蔽词 // @namespace http://tampermonkey.net/ // @version 2023-12-30 // @description 为nodeseek论坛添加屏蔽词功能 // @author bigQY // @match *://www.nodeseek.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=nodeseek.com // @grant none // @require https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js // @license MIT // @downloadURL https://update.greasyfork.org/scripts/483014/nodeseek%E8%AE%BA%E5%9D%9B%E5%B1%8F%E8%94%BD%E8%AF%8D.user.js // @updateURL https://update.greasyfork.org/scripts/483014/nodeseek%E8%AE%BA%E5%9D%9B%E5%B1%8F%E8%94%BD%E8%AF%8D.meta.js // ==/UserScript== (function() { 'use strict'; // 设置按钮 var headerDiv = document.querySelector("#nsk-head") var btn = document.createElement("button"); btn.innerHTML = "屏蔽词设置"; btn.classList.add("btn"); btn.style = "margin-left: 10px;"; headerDiv.appendChild(btn); // 设置面板 var panel = document.createElement("div"); panel.innerHTML = ` <div id="ns-block-words-setting"> <h2>屏蔽词设置</h2> <input type="checkbox" id="ns-block-words-checkbox-enable" name="ns-block-words-checkbox-enable" checked /> <label for="ns-block-words-checkbox-enable">启用屏蔽词</label> <br/> <input type="checkbox" id="ns-block-words-checkbox-hide" name="ns-block-words-checkbox-enable" checked /> <label for="ns-block-words-checkbox-hide">不显示被屏蔽的帖子或楼层</label> <br/> <p>屏蔽词列表(逗号分隔)</p> <textarea id='ns-block-words' style='width: 98%; height: 50vh;'></textarea> <br/> <div style="display: flex;justify-content: end;margin:10px"> <button id='ns-block-words-btn-save' class='btn' style="margin:0 10px">保存</button> <button id='ns-block-words-btn-cance' class='btn'>取消</button> </div> </div> `; panel.style = ` position: fixed; top: 10vh; left: 10vw; z-index: -1; display: block; width: 80vw; height: 0; background-color: rgba(255, 255, 255, 0.8); border-radius: 10px; backdrop-filter: blur(10px); padding:20px; transition: all 0.5s; opacity: 0; overflow: hidden; `; document.body.appendChild(panel); // 设置按钮点击事件 btn.onclick = function() { showSetting(); document.getElementById("ns-block-words").value = localStorage.getItem("ns-block-words"); }; // 保存按钮点击事件 document.getElementById("ns-block-words-btn-save").onclick = function() { localStorage.setItem("ns-block-words", document.getElementById("ns-block-words").value); localStorage.setItem("ns-block-words-enable", document.getElementById("ns-block-words-checkbox-enable").checked); localStorage.setItem("ns-block-words-hide", document.getElementById("ns-block-words-checkbox-hide").checked); hideSetting(); }; // 取消按钮点击事件 document.getElementById("ns-block-words-btn-cance").onclick = function() { hideSetting(); }; function showSetting() { panel.style.zIndex = 9998; panel.style.opacity = 1; panel.style.height = "80vh"; } function hideSetting() { panel.style.opacity = 0; panel.style.height = "0"; setTimeout(function() { if(panel.style.opacity == 0){ panel.style.zIndex = -1; } }, 500); } // dom ready初始化 $(document).ready(function() { // 屏蔽词列表 var blockWords = localStorage.getItem("ns-block-words"); if (blockWords == null) { blockWords = ""; } blockWords = blockWords.split(","); // 启用屏蔽词 var enable = localStorage.getItem("ns-block-words-enable"); enable = enable == 'true' ? true : false; var checkbox = document.getElementById("ns-block-words-checkbox-enable"); checkbox.checked = enable; // 隐藏屏蔽词 var hide = localStorage.getItem("ns-block-words-hide"); hide = hide == 'true' ? true : false; var checkbox2 = document.getElementById("ns-block-words-checkbox-hide"); checkbox2.checked = hide; // 屏蔽词列表 var textarea = document.getElementById("ns-block-words"); textarea.value = blockWords.join(","); // 屏蔽词 if (enable) { /* // 帖子界面 var comments = document.querySelectorAll(".content-item"); if (comments != null) { comments.forEach(function(comment) { var content = comment.querySelector(".post-content"); var contentText = content.innerText.toLowerCase(); // 将文本转换为小写 blockWords.forEach(function(word) { if (contentText.indexOf(word.toLowerCase()) != -1) { // 比较时将屏蔽词转换为小写 if (word==="") return; if (hide) { comment.style.display = "none"; } else { content.innerHTML = `<span style="color: red;">触发屏蔽词:${word}</span>` } } }); }); } */ // 列表界面 var posts = document.querySelectorAll(".post-list-content"); if (posts != null) { posts.forEach(function(post) { var content = post.querySelector(".post-title > a"); var contentText = content.innerText.toLowerCase(); // 将文本转换为小写 blockWords.forEach(function(word) { if (contentText.indexOf(word.toLowerCase()) != -1) { // 比较时将屏蔽词转换为小写 if (word==="") return; if (hide) { post.parentNode.style.display='none' } else { content.innerHTML = `<span style="color: red;">触发屏蔽词:${word}</span>` } } }); }); } } }); })();
2024年10月17日
2 阅读
0 评论
0 点赞
您是第
52781
位访客