Skip to content

Instantly share code, notes, and snippets.

@aleksasiriski
Last active August 8, 2024 16:29
Show Gist options
  • Save aleksasiriski/7256a04fa0d078bb232154566e6dfdd7 to your computer and use it in GitHub Desktop.
Save aleksasiriski/7256a04fa0d078bb232154566e6dfdd7 to your computer and use it in GitHub Desktop.
Greasemonkey redlib redirect
// ==UserScript==
// @name Reddit Redlib Redirect
// @namespace http://tampermonkey.net/
// @version 1.1
// @description Redirect reddit.com to redlib
// @author Aleksa Siriški
// @match http://reddit.com/*
// @match https://reddit.com/*
// @match http://www.reddit.com/*
// @match https://www.reddit.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Get the current URL
var currentURL = window.location.href;
// Replace reddit.com or www.reddit.com with redlib
var newURL = currentURL.replace(/(www\.)?reddit\.com/, 'redlib.tmina.org');
// Redirect to the new URL
window.location.replace(newURL);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment