您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Redirects default frontpage from 'best' to 'hot' and handles logo clicks
当前为
// ==UserScript== // @name Reddit Hot Redirect with Logo Click Handler // @namespace https://gf.qytechs.cn/en/users/594496-divided-by // @author dividedby // @description Redirects default frontpage from 'best' to 'hot' and handles logo clicks // @version 1.3 // @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html // @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name=Reddit+Hot+Donation // @contributionAmount $1 // @match https://www.reddit.com/* // @run-at document-start // ==/UserScript== (function() { 'use strict'; function redirectToHot() { if (window.location.pathname === '/' || window.location.pathname.startsWith('/r/')) { window.location.href = 'https://www.reddit.com/hot'; } } function handleLogoClick(e) { e.preventDefault(); window.location.href = 'https://www.reddit.com/hot'; } function attachLogoListener() { const logo = document.querySelector('#reddit-logo'); if (logo && !logo.dataset.hotRedirect) { logo.dataset.hotRedirect = true; logo.addEventListener('click', handleLogoClick); } } // Initial redirect redirectToHot(); // Set up MutationObserver to handle dynamically loaded content const observer = new MutationObserver((mutations) => { for (const mutation of mutations) { if (mutation.type === 'childList') { attachLogoListener(); } } }); // Start observing the document with the configured parameters observer.observe(document.body, { childList: true, subtree: true }); // Attach listener to initial logo if it exists attachLogoListener(); // Listen for navigation events window.addEventListener('popstate', redirectToHot); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址