Guest User

Old reddit redirect - Redirect reddit links to the old domain in order to see all comments and disab

a guest
Feb 25th, 2022
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. // ==UserScript==
  2. // [@name](/u/name) Old reddit redirect
  3. // [@namespace](/u/namespace) http://tampermonkey.net/
  4. // [@version](/u/version) 0.1
  5. // [@description](/u/description) Redirect reddit links to the old domain in order to see all comments and disable certain stylings
  6. // [@author](/u/author) You
  7. // [@match](/u/match) *://*.reddit.com/*
  8. // [@exclude](/u/exclude) *://old.reddit.com/*
  9. // [@grant](/u/grant) GM.xmlHttpRequest
  10. // [@connect](/u/connect) reddit.com
  11. // [@grant](/u/grant) GM_addStyle
  12. // [@icon](/u/icon) data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17. var reg = new RegExp('(.*)://www.reddit.com/(.*)');
  18. if (reg.test(document.URL))
  19. {
  20. //alert(document.URL);
  21. var newURL = 'https://old.reddit.com/'+window.location.pathname;
  22. window.location.href = newURL;
  23. }
  24.  
  25. })();
Add Comment
Please, Sign In to add comment