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.

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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);