您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
强制自己不要看不应该看的东西
当前为
// ==UserScript== // @name 提醒自己这里面有不该看的内容 // @namespace http://tampermonkey.net/ // @version 2025-03-24 1.6 // @description 强制自己不要看不应该看的东西 // @author You // @match *://*/* // @exclude *://www.baidu.com/* // @exclude *://*.bing.com/* // @exclude *://*.google.com/* // @exclude http://greasyfork.icu/* // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== // @grant none // ==/UserScript== (function() { 'use strict'; function alertContent(title) { var tips = "你正在浏览"+ title +"相关的内容,你不应该看这些内容,关闭它!" document.body.innerHTML = '<h1>不要浪费时间在这些内容上!!!</h1>' } setTimeout(() => { // 获取文章内容 var content = document.body.innerHTML if (location.href.indexOf('msn.cn') > -1) { content = document.getElementsByTagName('cp-article-reader')[0]._articleContent.body.innerHTML } // 简单判断是否在看不该看的东西 if ( (/第.*章/.test(content) && /书架/.test(content)) || content.indexOf("完本") > -1 ) { alertContent('小说') return; } if ( content.indexOf("海贼王") > -1 || content.indexOf("航海王") > -1 || content.indexOf("路飞") > -1 || content.indexOf("娜美") > -1) { alertContent('海贼王') return; } }, 2000) // Your code here... })();