// ==UserScript== // @name 自动跳转 QQ 拦截页面 // @namespace http://tampermonkey.net/ // @version 1.0 // @description 自动跳转 QQ 安全中心的中转页面,支持 ios.html 和 middlem.html,去除末尾多余斜杠 // @author DemoT-T // @match *://c.pc.qq.com/ios.html* // @match *://c.pc.qq.com/middlem.html* // @run-at document-start // @grant none // ==/UserScript== (function() { 'use strict'; const currentUrl = new URL(window.location.href); const path = currentUrl.pathname; let targetParam = null; if (path.includes('ios.html')) { targetParam = 'url'; } else if (path.includes('middlem.html')) { targetParam = 'pfurl'; } if (targetParam) { const rawTarget = currentUrl.searchParams.get(targetParam); if (rawTarget) { const decodedUrl = decodeURIComponent(rawTarget); let finalUrl = decodedUrl; if (finalUrl.endsWith('/')) { finalUrl = finalUrl.slice(0, -1); } setTimeout(() => { window.location.href = finalUrl; }, 300); } } })();