Wikipedia 2 Wikiwand (Global)

A fork/expansion of the user script "Wikipedia 2 Wikiwand" <https://greasyfork.org/zh-TW/scripts/13400-wikipedia-2-wikiwand> to make the script applicable to most languages of Wikipedia (hopefully). Trying to do the similar thing to official browser addon/extentions of Wikiwand, an elegant and nicer frontend of Wikipedia.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name          Wikipedia 2 Wikiwand (Global)
// @version       1.11
// @run-at        document-start
// @description   A fork/expansion of the user script "Wikipedia 2 Wikiwand" <https://greasyfork.org/zh-TW/scripts/13400-wikipedia-2-wikiwand> to make the script applicable to most languages of Wikipedia (hopefully). Trying to do the similar thing to official browser addon/extentions of Wikiwand, an elegant and nicer frontend of Wikipedia.
// @include       http://*.wikipedia.org/wiki/*
// @include       https://*.wikipedia.org/wiki/*
// @exclude       http://*.wikipedia.org/wiki/*?oldformat=true
// @exclude       https://*.wikipedia.org/wiki/*?oldformat=true
// @author        GHSRobert Ciang
// @grant         drhouse
// @namespace https://greasyfork.org/users/64873
// ==/UserScript==

var theurl = document.URL;
var res = theurl.replace(/([\w-]+).wikipedia.org\/wiki/gi, "www.wikiwand.com/$1");
var res = res.replace(/www.wikiwand.com\/zh(\/)/gi, "www.wikiwand.com/zh-tw$1");
window.location.href = (res);