Skip to content

Instantly share code, notes, and snippets.

@IzumiGoshi
Created December 29, 2021 03:42
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 IzumiGoshi/97ebec8aec48afb4e47c2e57609f46cf to your computer and use it in GitHub Desktop.
Save IzumiGoshi/97ebec8aec48afb4e47c2e57609f46cf to your computer and use it in GitHub Desktop.
Redirect to old.reddit.com for tampermonkey/greasemonkey
// ==UserScript==
// @name old reddit
// @namespace http://tampermonkey.net/
// @version 0.1
// @description redirect to old.reddit.com
// @author You
// @match https://www.reddit.com/*
// @icon https://www.google.com/s2/favicons?domain=reddit.com
// @grant none
// ==/UserScript==
window.addEventListener('load', function() {
//window.location.href = "https://old.reddit.com/";
var loc = "" + window.location;
var parts = loc.split('/');
if (parts.includes("r")) {
parts.forEach(function(item, i) { if (item == "www.reddit.com") parts[i] = "old.reddit.com"; });
loc = parts.join('/');
}
else {
loc = "old.reddit.com";
}
window.location.href = loc;
}, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment