Last active
April 10, 2023 10:52
-
-
Save crashmax-dev/cd6fc9a4f24624a3dce4b870f6d46c7a to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Terraria Wiki Redirect | |
// @author crashmax | |
// @match https://terraria.fandom.com/ru/wiki/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=terraria.org | |
// @grant none | |
// @run-at document-start | |
// ==/UserScript== | |
const NEW_WIKI_HREF = 'https://terraria-game.fandom.com/ru/wiki/' | |
function getLocationPath() { | |
const [lang, _, path] = document.location.pathname.split('/').filter(Boolean) | |
return path | |
} | |
const path = getLocationPath() | |
document.location.href = path === 'Terraria_Wiki' | |
? NEW_WIKI_HREF | |
: NEW_WIKI_HREF + path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment