// ==UserScript==
// @name fuun.fun强力学术
// @namespace http://tampermonkey.net/
// @version 1.0
// @auther Yt_4245
// @description 强制聚焦除了学习相关网站
// @match *://*/*
// @grant none
// @run-at document-start
// ==/UserScript==
(function() {
'use strict';
// 允许的白名单规则
const ALLOW_RULES = [
// 洛谷核心功能
/^https:\/\/(https\.)?fuun\.fun\/?$/i, // 首页
];
// 智能路径检测
function shouldAllow() {
const currentURL = window.location.href.toLowerCase();
// 白名单匹配检测
if (ALLOW_RULES.some(regex => regex.test(currentURL))) {
return true;
}
// 特殊放行逻辑
if (currentURL.startsWith('https://www.luogu.com.cn/problem/')) {
return true; // 放行具体题目页
}
return false;
}
// 执行重定向逻辑
if (!shouldAllow()) {
// 保留原网站信息用于调试
console.warn('[学术模式] 拦截非学习网站:', window.location.href);
// 清除当前页面内容
document.documentElement.innerHTML = '';
// 跳转至洛谷题库
window.location.replace('https://fuun.fun');
}
})();将这个东西放进篡改猴就可以了