您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
强制跳转alert到指定地址
// ==UserScript== // @name 黑龙江中医药大学跳过教务系统alert // @namespace https://github.com/Ohdmire // @version 0.1 // @description 强制跳转alert到指定地址 // @author Ohdmire // @match http://jwc.hljucm.net/jsxsd/xspj/xspj_save.do // @run-at document-start // @grant none // @license GPL-3.0 // ==/UserScript== (function() { 'use strict'; let scriptContent = document.head.innerHTML document.head.innerHTML = document.head.innerHTML.replace(""); const urlMatch = scriptContent.match(/parent\.location\.href='([^']+)'/); if (urlMatch && urlMatch[1]) { const domain = window.location.origin; const redirectUrl = urlMatch[1]; const fullUrl = domain + urlMatch[1]; console.log('提取到完整跳转URL:', fullUrl); // 直接跳转(不显示alert) window.location.href = fullUrl; // 或者使用parent跳转(如果是在iframe中) parent.location.href = redirectUrl; } })();