您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Ctrl-q to go from a Reddit user's profile to their associated /hot/ page. Instead of having to modify the URL manually.
// ==UserScript== // @name Reddit User Profile /hot/ Page Keyboard Shortcut // @namespace http://tampermonkey.net/ // @version 1.0 // @description Ctrl-q to go from a Reddit user's profile to their associated /hot/ page. Instead of having to modify the URL manually. // @author NiteCyper // @match *://www.reddit.com/user/* // @match *://www.reddit.com/u/* // @match *://reddit.com/user/* // @match *://reddit.com/u/* // @match *://old.reddit.com/u/* // @match *://old.reddit.com/user/* // @grant none // @run-at document-idle // @license GPL-3.0-or-later // ==/UserScript== // ===UserScript Comment === // Essentially vibe-coded this sh** with Google Gemini. idk Javascript. Took a lot of trial and error. // Tried Vimium C Chrome extension at first but kept getting errors. But now it works. // What's this for? Well, Do you like a reddit user's posts? Want to follow them? // This only matters if they post on their own profile. idk how they do that, but some do. // ===UserScript Comment === (function() { 'use strict'; document.addEventListener('keydown', function(event) { // Check for Ctrl+Q (event.key for character, event.keyCode for older browsers) if (event.ctrlKey && (event.key === 'q' || event.keyCode === 81)) { // Prevent the default browser action for Ctrl+Q event.preventDefault(); // Get the current URL let currentUrl = window.location.href; // Use a regular expression to add '/hot/' to the URL. // This handles cases with or without trailing slashes. let newUrl = currentUrl.replace(/\/?$/, '/hot/'); // Navigate to the new URL window.location.href = newUrl; } }); })();