Last active
July 3, 2019 14:07
-
-
Save pigfoot/e43748805cf802774c2fd3e1aee137d4 to your computer and use it in GitHub Desktop.
Wikipedia 2 Wikiwand
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Wikipedia 2 Wikiwand | |
// @version 1.0.2 | |
// @description A fork/expansion of the user script "Wikipedia 2 Wikiwand" <https://greasyfork.org/en/scripts/23047-wikipedia-2-wikiwand-global/>. | |
// @include /^https?:\/\/([\w-]+)(\.m)?\.wikipedia\.org\/(wiki|zh|zh-tw)\/.*$/ | |
// @exclude /^https?:\/\/([\w-]+)(\.m)?\.wikipedia\.org\/(wiki|zh|zh-tw)\/.*\?oldformat=true/ | |
// @namespace https://gist.github.com/pigfoot/e43748805cf802774c2fd3e1aee137d4 | |
// @author pigfoot Chen | |
// @run-at document-start | |
// @grant none | |
// ==/UserScript== | |
var theurl = document.URL; | |
var res = theurl.replace(/([\w-]+)(\.m)?\.wikipedia\.org\/(wiki|zh|zh-tw)/i, "www.wikiwand.com/$1"); | |
res = res.replace(/www\.wikiwand\.com\/zh\//i, "www.wikiwand.com/zh-tw/"); | |
window.location.href = (res); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Don't click "Raw" to install otherwise it cannot be updated.
Install: https://gist.github.com/pigfoot/e43748805cf802774c2fd3e1aee137d4/raw/Wikipedia2Wikiwand.user.js