Redirect From Reddit To Old Reddit

Userscript that redirects from Reddit to old Reddit

  1. // ==UserScript==
  2. // @name Redirect From Reddit To Old Reddit
  3. // @namespace https://vanyauhalin.me/
  4. // @version 0.1.0
  5. // @icon https://www.google.com/s2/favicons/?sz=64&domain=old.reddit.com
  6. // @description Userscript that redirects from Reddit to old Reddit
  7. // @author Ivan Uhalin <vanyauhalin@gmail.com> (https://vanyauhalin.me/)
  8. // @license MIT
  9. // @homepageURL https://github.com/vanyauhalin/userscript-redirect-from-reddit-to-old-reddit/
  10. // @contributionURL https://github.com/vanyauhalin/userscript-redirect-from-reddit-to-old-reddit/
  11. // @match https://www.reddit.com/*
  12. // @run-at document-start
  13. // ==/UserScript==
  14. (() => {
  15. "use strict";
  16. function main() {
  17. let u = new URL(window.location.pathname, "https://old.reddit.com/");
  18. window.location.replace(u.toString());
  19. }
  20. main();
  21. })();