您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Replace main links from home subreddits to threads directly rather than posts (Images, other websites, etc.) Only affects the main subreddit listing, not comments.
// ==UserScript== // @name Old Reddit Open Thread Instead of Post // @namespace http://tampermonkey.net/ // @version 1.3 // @description Replace main links from home subreddits to threads directly rather than posts (Images, other websites, etc.) Only affects the main subreddit listing, not comments. // @author Berkay // @match https://old.reddit.com/r/* // @match https://www.reddit.com/r/* // @icon https://www.google.com/s2/favicons?sz=64&domain=reddit.com // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // Exit the script if the URL contains '/comments/', indicating a thread page if (window.location.pathname.includes('/comments/')) { return; } // Function to replace post links with comment/thread links function replacePostLinks() { // Select all post containers within the main listing const postContainers = document.querySelectorAll('div.thing[data-context="listing"]'); postContainers.forEach(container => { // Find the title link within the container const titleLink = container.querySelector('a[data-event-action="title"]'); // Find the comments link within the container const commentsLink = container.querySelector('a[data-event-action="comments"]'); if (titleLink && commentsLink) { // Replace the href of the title link with the href of the comments link titleLink.href = commentsLink.href; } }); } // Run the function when the page loads window.addEventListener('load', replacePostLinks); // Observe DOM changes to handle dynamically loaded content (e.g., infinite scroll) const observer = new MutationObserver((mutations) => { mutations.forEach(() => { replacePostLinks(); }); }); observer.observe(document.body, { childList: true, subtree: true }); })();