// ==UserScript== // @name 指定网站跳转 // @description 自定义的相关网站自动跳转 // @namespace https://greasyfork.org/zh-CN/scripts/372716 // @version 0.2 // @author lqzh // @copyright lqzh // @include http*://eslint.org/* // @grant none // @downloadURL none // ==/UserScript== const list = [{ o: "eslint.org", r: "cn.eslint.org", }]; (function () { 'use strict'; let host = location.host; for (let i = 0; i < list.length; i++) { let site = list[i]; if (host == site.o) { location.href = location.protocal + site.r + location.pathname + location.search; break; } } })();