// ==UserScript== // @name NodeSeek关闭外部跳转提醒 // @namespace https://greasyfork.org/zh-CN/scripts/476472 // @version 1.1 // @description 取 "jump?to=" 后网址替换原URL实现关闭跳转提醒 // @author endercat // @license MIT // @match *://*.nodeseek.com/* // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; // 等待页面加载完成后运行脚本 window.addEventListener('load', function() { // 获取所有包含 "jump?to=" 的链接 var links = document.querySelectorAll('a[href*="jump?to="]'); // 遍历每个链接并修改它们 links.forEach(function(link) { // 获取链接的原始URL var originalUrl = link.href; // 使用正则表达式匹配 "jump?to=" 后面的部分,并替换为对应的URL var modifiedUrl = originalUrl.replace(/.*jump\?to=([^&]*).*/, '$1'); // 修改链接的href属性 link.href = decodeURIComponent(modifiedUrl); }); }); })();