wikipeida 繁体中文跳简体中文

https://zh.wikipedia.org/zh/* to https://zh.wikipedia.org/zh-cn/*

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name				wikipeida 繁体中文跳简体中文
// @version				0.1
// @author				LisonFan
// @match				https://zh.wikipedia.org/wiki/*
// @match				https://zh.wikipedia.org/zh/*
// @match				https://zh.wikipedia.org/zh-hk/*
// @match				https://zh.wikipedia.org/zh-mo/*
// @match				https://zh.wikipedia.org/zh-tw/*
// @match				https://zh.wikipedia.org/zh-sg/*
// @grant				none
// @icon				https://zh.wikipedia.org/static/favicon/wikipedia.ico
// @namespace 			https://lisonfan.com/
// @description https://zh.wikipedia.org/zh/* to https://zh.wikipedia.org/zh-cn/*
// ==/UserScript==

(function() {
    'use strict';
	var href = location.href;
    
    var changeHref;
    
    if (href.indexOf("/wiki/") > 0){
        changeHref = href.replace(/\/wiki\//g, "/zh-cn/");
    }else if (href.indexOf("/zh/")  > 0){
        changeHref = href.replace(/\/zh\//g, "/zh-cn/");
    }else if (href.indexOf("/zh-hk/")  > 0){
        changeHref = href.replace(/\/zh-hk\//g, "/zh-cn/");
    }else if (href.indexOf("/zh-mo/")  > 0){
        changeHref = href.replace(/\/zh-mo\//g, "/zh-cn/");
    }else if (href.indexOf("/zh-sg/")  > 0){
        changeHref = href.replace(/\/zh-sg\//g, "/zh-cn/");
    }else if (href.indexOf("/zh-tw/")  > 0){
        changeHref = href.replace(/\/zh-tw\//g, "/zh-cn/");
    }
    location.href = changeHref;
})();