├── .gitignore ├── LICENSE ├── README.md ├── background.js ├── img ├── icon128.png └── icon48.png └── manifest.json /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/* -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2014 Tom Watson 5 | Copyright (c) 2019 Erisa Arrowsmith 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # New Reddit Redirect 2 | 3 | Love Reddit's redesign? New Reddit Redirect will ensure that you always load the standard (www.reddit.com) design when linked to old or new subdomains. 4 | 5 | **DO NOT** install alongside "Old Reddit Redirect" or you will be unable to access Reddit until one extension is removed. 6 | 7 | Will force all reddit.com usage to www.reddit.com. Will work when navigating to the site, opening links, using old bookmarks. Works regardless of whether you are logged in or not, and in incognito mode. 8 | 9 | Contrary to the name, will not force you to new regardless of user settings. This extension essentially disables the forced design subdomains (`old.reddit.com` and `new.reddit.com` and replaces them with your preferred). Since most people who love to use the old design are already forcing their reddit links to `old.reddit.com`, this helps you to click them and end up where you normally would if not forced. 10 | The name is a play on the original code's name and because the author of this modification created it with the intent of redirecting old links to use their default style, which is set to new. 11 | 12 | ## License 13 | 14 | [Original code](https://github.com/tom-james-watson/old-reddit-redirect) copyright Tom Watson. Code released under [the MIT license](LICENSE.txt). 15 | Modified code copyright Erisa Arrowsmith. Code released under [the MIT license](LICENSE.txt). 16 | -------------------------------------------------------------------------------- /background.js: -------------------------------------------------------------------------------- 1 | const standardReddit = "https://www.reddit.com"; 2 | 3 | chrome.webRequest.onBeforeRequest.addListener( 4 | function(details) { 5 | return { 6 | redirectUrl: 7 | standardReddit + details.url.match(/^https?:\/\/[^\/]+([\S\s]*)/)[1] 8 | }; 9 | }, 10 | { 11 | urls: [ 12 | "*://np.reddit.com/*", 13 | "*://old.reddit.com/*", 14 | "*://new.reddit.com/*" 15 | ], 16 | types: [ 17 | "main_frame", 18 | "sub_frame", 19 | "stylesheet", 20 | "script", 21 | "image", 22 | "object", 23 | "xmlhttprequest", 24 | "other" 25 | ] 26 | }, 27 | ["blocking"] 28 | ); -------------------------------------------------------------------------------- /img/icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Erisa/new-reddit-redirect/b259b6d56340ca386a133371b1b092525e2e41f0/img/icon128.png -------------------------------------------------------------------------------- /img/icon48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Erisa/new-reddit-redirect/b259b6d56340ca386a133371b1b092525e2e41f0/img/icon48.png -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "New Reddit Redirect", 3 | "author": "Erisa Arrowsmith", 4 | "description": "Ensure Reddit always loads your preferred design (Mostly designed for New)", 5 | "version": "1.0.1", 6 | "manifest_version": 2, 7 | "background": {"scripts":["background.js"]}, 8 | "icons": { 9 | "48": "img/icon48.png", 10 | "128": "img/icon128.png" 11 | }, 12 | "permissions": [ 13 | "webRequest", 14 | "webRequestBlocking", 15 | "*://old.reddit.com/*", 16 | "*://new.reddit.com/*", 17 | "*://np.reddit.com/*" 18 | ] 19 | } 20 | --------------------------------------------------------------------------------