Last active
June 11, 2016 18:01
-
-
Save RikerW/5041037ae04e1d28c6f001243b4a256a to your computer and use it in GitHub Desktop.
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
'use strict'; | |
// ==UserScript== | |
// @name TF2 Wiki Englishifier | |
// @namespace Riker Wachtler | |
// @version 1.2 | |
// @description Redirects a non-English TF2 Wiki page to the English one. | |
// @author You | |
// @match https://wiki.teamfortress.com/wiki/* | |
// @grant none | |
// ==/UserScript== | |
// When linked to a TF2 Wiki pages that isn't in english (i.e. "...wiki/Rocket_Launcher/cs") redirects to the english version (i.e ".../wiki/Rocket_Launcher"). | |
// Makes the random page button more useful. | |
// Set the extension var (TODO: get from cookie) to choose the specific language. | |
(function () { | |
'use strict'; | |
extension = ""; // Set to "/es" for spanish, "/zh-hant" for chinese, etc. Make sure to include the / though. (i.e. `... = "/es";`) | |
if (window.location.href.replace(/(wiki\/.+?)\/.+/, "$1") != window.location.href) { | |
window.open(window.location.href.replace(/(wiki\/.+?)\/.+/, "$1" + extension), "_self"); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment