Skip to content

Instantly share code, notes, and snippets.

@wodim
Last active March 22, 2020 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wodim/38e2338cb7afb13a044b7888e5193558 to your computer and use it in GitHub Desktop.
Save wodim/38e2338cb7afb13a044b7888e5193558 to your computer and use it in GitHub Desktop.
Script that redirects shitty sites to good sites
// ==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