Chrawnus

Reddit Archive Redirect

Dec 15th, 2025 (edited)
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Reddit Archive Redirect
  3. // @description  Redirect deleted Reddit posts to archive with selectable backend
  4. // @match        *://*.reddit.com/r/*/comments/*
  5. // @grant        none
  6. // ==/UserScript==
  7.  
  8. (function() {
  9.     'use strict';
  10.  
  11.     // Helper to open archive page
  12.     function openArchive(backend) {
  13.         const m = location.pathname.match(/\/comments\/([^\/]+)/);
  14.         if (!m) return;
  15.         window.open(`https://ihsoyct.github.io/index.html?comments=${m[1]}&backend=${backend}`, '_blank');
  16.     }
  17.  
  18.     // Listen for key combinations
  19.     document.addEventListener('keydown', function(e) {
  20.         // Only trigger if not typing in a form
  21.         if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA' || e.target.isContentEditable) return;
  22.  
  23.         // Shift + Alt + A → auto artic_shift
  24.         else if (e.shiftKey && e.altKey && e.code === 'KeyA') {
  25.             openArchive('artic_shift');
  26.         }
  27.  
  28.         // Shift + Alt + P → auto pullpush
  29.         else if (e.shiftKey && e.altKey && e.code === 'KeyP') {
  30.             openArchive('pullpush');
  31.         }
  32.     });
  33. })();
  34.  
Advertisement
Add Comment
Please, Sign In to add comment