版本比较
军火库说是
正文
增加 75 行删除 0 行
873 行未改动全部展开874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956138 行未改动全部展开873 行未改动全部展开::::::info[背景]https://www.luogu.com.cn/paste/9jb9zd4e::::::info[跳转]```js// ==UserScript==// @name 洛谷网页跳转// @namespace http://tampermonkey.net/// @version 2026-08-03// @description jump jump jump jump jump jump jump jump jump jump jump jump jump jump jump jump pmuj pmuj pmuj pmuj pmuj pmju pmuj pmuj pmuj pmuj pmuj// @author You// @match https://*/*// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==// @grant none// ==/UserScript==
(function() { 'use strict';
const host = location.host; const pathname = location.pathname;
// 规则 1:访问 https://www.luogu.com/problem/solution/* 跳转到 .com.cn if (host === 'www.luogu.com' && pathname.startsWith('/problem/solution/')) { location.replace(location.href.replace('www.luogu.com', 'www.luogu.com.cn')); return; }
// 规则 3:访问 https://www.luogu.com (仅根目录/首页)跳转到 .com.cn if (host === 'www.luogu.com' && (pathname === '/' || pathname === '')) { location.replace('https://www.luogu.com.cn' + location.search + location.hash); return; }
// 规则 2:访问 https://www.luogu.com.cn/article/* 且页面标题包含“安全访问中心”时跳转到 .com if (host === 'www.luogu.com.cn' && pathname.startsWith('/article/')) { const checkAndRedirect = () => { if (document.title && document.title.includes('安全访问中心')) { location.replace(location.href.replace('www.luogu.com.cn', 'www.luogu.com')); } };
// 立即尝试检测一次 checkAndRedirect();
// DOM 加载完成后检测一次 if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', checkAndRedirect); }
// 监听 <title> 的动态变化(适应 SPA 或防御页面异步修改标题) const observer = new MutationObserver(() => checkAndRedirect()); observer.observe(document, { subtree: true, childList: true, characterData: true }); }
// 规则 2:访问 https://www.luogu.com.cn/article/* 且页面标题包含“安全访问中心”时跳转到 .com if (host === 'www.luogu.com.cn' && pathname.startsWith('/paste/')) { const checkAndRedirect = () => { if (document.title && document.title.includes('安全访问中心')) { location.replace(location.href.replace('www.luogu.com.cn', 'www.luogu.com')); } };
// 立即尝试检测一次 checkAndRedirect();
// DOM 加载完成后检测一次 if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', checkAndRedirect); }
// 监听 <title> 的动态变化(适应 SPA 或防御页面异步修改标题) const observer = new MutationObserver(() => checkAndRedirect()); observer.observe(document, { subtree: true, childList: true, characterData: true }); }})();```:::::::::::success[工具]:::info[文本加密&解密]```cpp138 行未改动全部展开