您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Replace main links from home subreddits to threads directly rather than posts (Images, other websites, etc.)
当前为
// ==UserScript== // @name Old Reddit Open Thread Instead of Post // @namespace http://tampermonkey.net/ // @version 1.2 // @description Replace main links from home subreddits to threads directly rather than posts (Images, other websites, etc.) // @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'; // Function to replace post links with comment/thread links function replacePostLinks() { // Select all post containers const postContainers = document.querySelectorAll('div.thing'); 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); // Optionally, observe DOM changes to handle dynamically loaded content const observer = new MutationObserver((mutations) => { mutations.forEach(() => { replacePostLinks(); }); }); observer.observe(document.body, { childList: true, subtree: true }); })();