// ==UserScript== // @name 萌娘百科跳转镜像网站 // @version 1.0 // @description 在访问主站时自动跳转到镜像网站:'moegirl.uk' // @match https://mzh.moegirl.org.cn/* // @match https://zh.moegirl.org.cn/* // @match https://moegirl.uk/* // @license MIT // @grant none // @run-at document-start // @namespace http://tampermonkey.net/ // @downloadURL none // ==/UserScript== (function() { 'use strict'; const targetHost = 'https://moegirl.uk'; const pathRegex = /moegirl\.org\.cn(.*)$/; const match = pathRegex.exec(window.location.href); const newPath = match ? match[1] : ''; window.location.replace(`${targetHost}${newPath}`); })();