Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Reddit Archive Redirect
- // @description Redirect deleted Reddit posts to archive with selectable backend
- // @match *://*.reddit.com/r/*/comments/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- // Helper to open archive page
- function openArchive(backend) {
- const m = location.pathname.match(/\/comments\/([^\/]+)/);
- if (!m) return;
- window.open(`https://ihsoyct.github.io/index.html?comments=${m[1]}&backend=${backend}`, '_blank');
- }
- // Listen for key combinations
- document.addEventListener('keydown', function(e) {
- // Only trigger if not typing in a form
- if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA' || e.target.isContentEditable) return;
- // Shift + Alt + A → auto artic_shift
- else if (e.shiftKey && e.altKey && e.code === 'KeyA') {
- openArchive('artic_shift');
- }
- // Shift + Alt + P → auto pullpush
- else if (e.shiftKey && e.altKey && e.code === 'KeyP') {
- openArchive('pullpush');
- }
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment