Last active
January 26, 2025 09:11
-
-
Save sidneys/759bdb70442597638d63c4ed170020c9 to your computer and use it in GitHub Desktop.
Userscript | Reddit | Expand All Comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Reddit | Expand All Comments | |
// @namespace de.sidneys.userscripts | |
// @homepage https://gist.githubusercontent.com/sidneys/759bdb70442597638d63c4ed170020c9/raw/ | |
// @version 1.0.0 | |
// @description Automatically expands all comment replies within Reddit threads | |
// @author sidneys | |
// @icon https://www.redditstatic.com/desktop2x/img/favicon/apple-icon-180x180.png | |
// @include http*://www.reddit.com/*/comments/* | |
// @require https://greasyfork.org/scripts/38888-greasemonkey-color-log/code/Greasemonkey%20%7C%20Color%20Log.js | |
// @require https://greasyfork.org/scripts/38889-greasemonkey-waitforkeyelements-2018/code/Greasemonkey%20%7C%20waitForKeyElements%202018.js | |
// @run-at document-end | |
// ==/UserScript== | |
/** | |
* @default | |
* @constant | |
*/ | |
DEBUG = false | |
/** | |
* Expand all comments recursively | |
*/ | |
let expandComments = () => { | |
console.debug('expandComments'); | |
// Search for "X more replies" element | |
waitForKeyElements('div[id^="moreComments"] p', (element) => { | |
if (!element.innerText.match(/^(\d+) more/)) { return } | |
element.click() | |
console.debug('Comment thread expanded.'); | |
}); | |
} | |
/** | |
* Init | |
*/ | |
let init = () => { | |
console.info('init'); | |
expandComments() | |
}; | |
/** | |
* @listens window:Event#load | |
*/ | |
window.addEventListener('load', () => { | |
console.debug('window#load'); | |
init(); | |
}); |
Doesn't work for me.
Google Chrome v132.0.6834.111 (Official Build) (64-bit)
Violentmonkey 2.29.0
On Jan 26, 2025, I used an AI to create this userscript and it seems to be working.
https://greasyfork.org/en/scripts/524909-reddit-auto-expand-hidden-comments-by-ai
@realAzazello - I don't know if my userscript will work for you, but you could give it a try.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello. I was hoping this would be the solution to years'-long struggle but it's not working for my setup:
Firefox 115.6.0esr
Tampermoneky 5.11
A few items:
http*://old.reddit.com/*/comments/*
to user Includes, but it still doesn't work.http*://old.reddit.com/*/comments/*
andhttp*://www.reddit.com/*/comments/*
to User Matches but still no joy.// @grant none
.I do have several other userscripts installed specifically for Reddit (and whole bunch for other stuff); let me know if there are any conflicts I should look out for.