Revisions
-
zudsniper revised this gist
Oct 23, 2024 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,8 +2,8 @@ // @name Old Reddit Redirect // @namespace zod.tf // @version 0.1 // @description Forces usage of the old reddit version (from Tom Watson project, forked) // @author zudsniper // @match https://reddit.com/* // @match https://www.reddit.com/* // @match https://np.reddit.com/* -
zudsniper renamed this gist
Oct 23, 2024 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ // ==UserScript== // @name Old Reddit Redirect // @namespace zod.tf // @version 0.1 // @description Forces usage of the old reddit version // @author Tom Watson -
pjmore created this gist
Nov 12, 2023 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,66 @@ // ==UserScript== // @name Reddit Old Layout // @namespace 9bf36c681d35d52913b3bda74ddf6127318ed7b0 // @version 0.1 // @description Forces usage of the old reddit version // @author Tom Watson // @match https://reddit.com/* // @match https://www.reddit.com/* // @match https://np.reddit.com/* // @match https://amp.reddit.com/* // @match https://i.reddit.com/* // @grant none // @run-at document-start // ==/UserScript== const excludedPaths = [ /^\/media/, /^\/poll/, /^\/rpan/, /^\/settings/, /^\/topics/, /^\/community-points/, /^\/r\/[a-zA-Z0-9_]+\/s\/.*/, // eg https://reddit.com/r/comics/s/TjDGhcl22d /^\/appeals?/, /\/r\/.*\/s\//, ]; const oldReddit = "https://old.reddit.com"; const imageUrlHostnames = ["preview.redd.it", "i.redd.it"]; (function () { 'use strict'; console.log("Handling the url " + window.location.href); const url = new URL(window.location.href); if (url.hostname === "old.reddit.com"){ console.log("Was already on old reddit. Doing nothing."); return; } for (const hostname of imageUrlHostnames) { if (url.hostname === hostname) { console.log("Hostname matched " + hostname + ". Skipping"); return; } } for (const path of excludedPaths) { if (path.test(url.pathname)){ console.log(`path ${url.pathname} matched the excluded path ${path}`); return; } } if (url.pathname.indexOf("/gallery") === 0) { const gallery_redirect = oldReddit + "/comments" + url.pathname.slice("/gallery".length); console.log(`Redirecting to ${gallery_redirect}`); document.location.replace(gallery_redirect) }else{ const redirect = oldReddit + url.pathname + url.search + url.hash; console.log(`Redirecting to oldreddit ${redirect}`); document.location.replace(redirect); } })();