Greasy Fork is available in English.
用于维基百科移动域名自动跳转为pc域名并且自动选择大陆简体,选择大陆简体版本仅限于检测到出现多中文版本的时候才会启用
// ==UserScript==
// @name 维基百科移动域名自动跳转&自动选择大陆简体
// @version 0.06
// @description 用于维基百科移动域名自动跳转为pc域名并且自动选择大陆简体,选择大陆简体版本仅限于检测到出现多中文版本的时候才会启用
// @namespace http://greasyfork.icu/en/users/30-opsomh
// @include https://zh.m.wikipedia.org/*
// @include https://zh.wikipedia.org/*
// @grant none
// @inject-into auto
// @run-at document-start
// @license 暂无
// ==/UserScript==
var url;
function getStr(str) { //取中间字符
var res = str.match(new RegExp(`https://zh.(.*?)wikipedia.org/(.*?)/(.*?)$`));
return res ? res : -1;
}
urla=getStr(window.location.href)[1];
urlb=getStr(window.location.href)[2];
console.log(urla);
console.log(urlb);
if(urla == `m.` || urlb == `zh-hans` || urlb == `zh`){
window.stop();
url=window.location.href.replace(urla, '').replace(/wikipedia.org\/.*?\//, 'wikipedia.org/zh-cn/');
console.log(url);
location.assign(url);
}