Created
November 18, 2021 16:20
-
-
Save brussell98/3710cf82e89a16f26628b1e4f72c783f to your computer and use it in GitHub Desktop.
Redirects to old.reddit.com when private browsing
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 Reddit Old Layout | |
// @namespace 9bf36c681d35d52913b3bda74ddf6127318ed7b0 | |
// @version 0.3 | |
// @description Forces usage of the old reddit version | |
// @author Brussell | |
// @match https://www.reddit.com/* | |
// @match https://reddit.com/* | |
// @grant none | |
// @run-at document-start | |
// ==/UserScript== | |
(function () { | |
'use strict'; | |
const newOnlyRoutes = ['/gallery', '/poll']; | |
if (GM_info.isIncognito && !newOnlyRoutes.some(route => top.location.pathname.startsWith(route))) | |
top.location.hostname = "old.reddit.com"; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment