Last active
March 22, 2020 20:04
-
-
Save wodim/38e2338cb7afb13a044b7888e5193558 to your computer and use it in GitHub Desktop.
Script that redirects shitty sites to good sites
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 Redirects | |
// @author You | |
// @match *://*/* | |
// ==/UserScript== | |
(function() { | |
'use strict' | |
const redirections = new Map([ | |
['doom.fandom.com', 'doomwiki.org'], | |
['wowwiki.fandom.com/wiki', 'wow.gamepedia.com'], | |
['oldschoolrunescape.fandom.com/wiki', 'oldschool.runescape.wiki/w'], | |
['runescape.fandom.com/wiki', 'runescape.wiki/w'], | |
['half-life.fandom.com', 'combineoverwiki.net'], | |
['www.reddit.com', 'old.reddit.com'], | |
]) | |
for (const [from, to] of redirections) { | |
if (window.location.href.indexOf('http://' + from) === 0 || | |
window.location.href.indexOf('https://' + from) === 0) { | |
window.location = window.location.href.replace(from, to) | |
break | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment