您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically closes every child comment recursively, allowing for slowly opening them as you read comments and being able to overview top level comments with less noise.
// ==UserScript== // @name Hacker News auto collapse replies. // @description Automatically closes every child comment recursively, allowing for slowly opening them as you read comments and being able to overview top level comments with less noise. // @namespace https://github.com/luluco250 // @license MIT // @version 1.0.0 // @grant none // @match https://news.ycombinator.com/item // ==/UserScript== window.addEventListener("load", () => { "use strict"; const indents = document.getElementsByClassName("ind"); for (const indent of indents) { if (indent.getAttribute("indent") === "0") continue; const commentContainer = indent.nextSibling.nextSibling; const toggles = commentContainer.getElementsByClassName("togg"); for (const toggle of toggles) { toggle.click(); } } });