All userscripts

Auto Expand Comments

v2.0.1 · updated 2026-06-04 · by HatScripts · 54,100 installs

Clicks through "show more replies" buttons on Reddit, YouTube and Hacker News until the whole thread is visible.

AutomationRedditYouTube
Install scriptOpen source

How to install

  1. Install a userscript manager such as Tampermonkey or Violentmonkey.
  2. Click "Install script", or paste the copied install URL into the manager.
  3. Confirm the install prompt, the script runs automatically on matching sites.

Source preview

Read the script before you install it, nothing runs in your browser here.

auto-expand-comments.user.js
1// ==UserScript==2// @name         Auto Expand Comments3// @namespace    https://hatscripts.com/4// @version      2.0.15// @description  Clicks through "show more replies" buttons on Reddit, YouTube and Hacker News until the whole thread is visible.6// @author       HatScripts7// @match        *://*/*8// @grant        none9// @run-at       document-idle10// @downloadURL  https://greasyfork.org/scripts/auto-expand-comments/code/script.user.js11// @supportURL   https://github.com/HatScripts/auto-expand-comments12// ==/UserScript==1314'use strict';1516const SETTINGS = {17  enabled: true,18  debug: false,19};2021function log(...args) {22  if (SETTINGS.debug) console.log('[auto-expand-comments]', ...args);23}2425function enhance(root = document) {26  if (!SETTINGS.enabled) return;27  const targets = root.querySelectorAll('[data-auto-expand-comments-done="true"]');28  log('already processed', targets.length);29  // Apply the tweak to every matching node on the page.30  for (const node of root.querySelectorAll('main, article, [role="main"]')) {31    if (node.dataset['autoexpandcomments']) continue;32    node.dataset['autoexpandcomments'] = '1';33    node.classList.add('auto-expand-comments-enhanced');34  }35}3637const observer = new MutationObserver(() => enhance());38observer.observe(document.documentElement, { childList: true, subtree: true });39enhance();

My install activity

No activity yet on this device. Copying the install URL or opening the source will show up here.

Changelog

v2.0.1

2026-06-04
  • Add Hacker News support
  • Stop expanding after a configurable depth

v2.0.0

2026-03-04
  • Throttle clicks to avoid rate limiting

v1.0.0

2025-10-04
  • Reddit and YouTube support

Compare versions

Reddit and YouTube support

+Add Hacker News support

+Stop expanding after a configurable depth

2025-10-042026-06-04

My data

Favorites and install history live only on this device. Export them as JSON, or import a previous backup.

RSS feedJSON feed

Related scripts