您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
无
// ==UserScript== // @name 洛谷国内国际站自动切换 // @namespace http://tampermonkey.net/ // @version 1.4-dev // @description 无 // @author 928418 // @match */* // @icon https://www.google.com/s2/favicons?sz=64&domain=luogu.com.cn // @grant none // @license GPL // ==/UserScript== (function() { 'use strict'; // Your code here... var url = window.location.href; var path = window.location.pathname; var host = window.location.host; if (host == "www.luogu.com.cn") { //国内站,看path中是否含有paste,article或user //部分老的discuss必须去国际站,也加上 // 这里特判消息中心 if (path.substr(1, 5) == "paste" || path.substr(1, 7) == "article" || (path.substr(1, 4) == "user" && path.substr(1, 17) != "user/notification") || path.substr(1, 7) == "discuss") window.location.host = "www.luogu.com"; } else if (host == "www.luogu.com") { //相反,没有就转国内,防止503 if (path.substr(1, 5) != "paste" && path.substr(1, 7) != "article" && path.substr(1, 4) != "user" && path.substr(1, 7) != "discuss") window.location.host = "www.luogu.com.cn"; } })();