// ==UserScript== // @name 取消跳转拦截 // @namespace https://bbs.tampermonkey.net.cn/ // @version 2.0 // @description 取消跳转拦截 // @author 冰冻大西瓜 // @match https://link.juejin.cn/?target=* // @match https://c.pc.qq.com/middlem.html* // @match https://link.zhihu.com/?target=* // @run-at document-start // ==/UserScript== // 跳转实现 const jumpUrl = regular => { window.location.href = decodeURIComponent(window.location.href.match(regular)[1]) } // 配置项 const domain = { 'c.pc.qq.com': jumpUrl(/pfurl=(.*)&pfuin/), 'link.zhihu.com': jumpUrl(/target=(.*)/), } // 匹配URL switch (window.location.hostname) { case 'c.pc.qq.com': domain['c.pc.qq.com']() break case 'link.zhihu.com': case 'link.juejin.cn': domain['link.zhihu.com']() break default: break }