Greasy Fork is available in English.
中文(zh)维基百科自动跳转至大陆简体(zh-cn),移动版萌娘百科自动跳转至电脑版
当前为
// ==UserScript==
// @name 中文维基百科转换成简体
// @namespace polonium.space
// @version 0.4
// @description 中文(zh)维基百科自动跳转至大陆简体(zh-cn),移动版萌娘百科自动跳转至电脑版
// @author chemPolonium
// @include http*://zh.wikipedia.org/*
// @include http*://*.m.wikipedia.org/*
// @include http*://zh.moegirl.org.cn/*
// @include http*://mzh.moegirl.org.cn/*
// ==/UserScript==
(function() {
'use strict';
let replacedUrl = document.URL;
let ismodified = false;
if (replacedUrl.match(/\/\/m?zh\./) && !replacedUrl.includes('/zh-cn/')) {
replacedUrl = replacedUrl.replace(/\/zh\/|\/zh-tw\/|\/zh-hans\/|\/wiki\//,'/zh-cn/');
ismodified = true;
}
if (replacedUrl.includes('.m.')) {
replacedUrl = replacedUrl.replace('.m.','.');
ismodified = true;
}
if (replacedUrl.includes('//mzh')) {
replacedUrl = replacedUrl.replace('//mzh','//zh');
ismodified = true;
}
if (ismodified) {
window.location = replacedUrl;
}
})();