// ==UserScript== // @name 萌娘百科跳转镜像网站 // @namespace http://tampermonkey.net/ // @version 0.1 // @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 // @downloadURL none // ==/UserScript== (function() { 'use strict'; // 获取当前 URL const currentUrl = window.location.href; // 定义目标 URL const targetUrl = 'https://moegirl.uk/'; // 检查当前 URL 并重定向 if (currentUrl.includes('mzh.moegirl.org.cn') || currentUrl.includes('zh.moegirl.org.cn')) { // 构建新的 URL const newPath = currentUrl.split('.org.cn')[1]; // 重定向到新的网址 window.location.replace(targetUrl + newPath); } })();