Last active
August 8, 2024 16:29
-
-
Save aleksasiriski/7256a04fa0d078bb232154566e6dfdd7 to your computer and use it in GitHub Desktop.
Greasemonkey redlib redirect
This file contains 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 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