When there are lots of comments under a post, they're automatically collapsed, and if you want to find (Ctrl + F) a specific word/phrase on the page, you have to look for and click the show (n) more comments link under each post separately. Here's a feature request: add an Expand all comments button above all posts.
2 Answers
That would be a nice-to-have feature, but doubt it will be done. Most people are not going to use it.
So as alternative, in a page where you want to expand all the comments you can do that by following those steps:
Open the browser developer console. (e.g. in Chrome CTRL+SHIFT+I)
Copy and paste the following:
function TriggerSingleLink(links, index) { if (index >= links.length) { console.log("All done."); return; } var oLink = links[index]; oLink.trigger('click'); window.setTimeout(function() { TriggerSingleLink(links, index + 1) }, 500); } var links = []; $('.js-show-link').each(function() { var oLink = $(this); if ($.trim(oLink.text()).length > 0) links.push(oLink); }); if (links.length > 0) { console.log("Expanding " + links.length + " link" + ((links.length > 1) ? "s" : "") +"..."); TriggerSingleLink(links, 0); } else { console.log("No valid expand links found."); }
Press ENTER. All comments will be expanded in all posts.
You can then close the console, e.g. F12 in Chrome.
-
4I believe that most people would use it. However, thanks for the js. Very useful......will greasemonkey a variant out later on FF to see. Jan 2, 2017 at 5:41
-
@tgm1024 voting ratio on the request is 6/4 but still... doubt the team will spend time on this. Jan 2, 2017 at 7:25
-
1I wonder what the rationale is for not wanting it? At the very least a setting for it to be the default would be completely innocuous to the naysayers. Jan 3, 2017 at 4:04
-
@tgm1024 personally I do want it because I read all the comments sometimes, and would like to be able to search them too. However, being here enough time, I believe many users consider comments as "noise" and prefer to see as little of them as possible. For them, "expand all" will be just pointless. Jan 3, 2017 at 9:12
-
3Well in that case, an option to fold away all comments under a "+" button would be what they want. What I understand are 1. All comments, and 2. No comments. Seeing Partial Comments picked behind my back makes no sense to me: If comments are there at all, I want to be able to follow the conversation. Not sit there and guess about what may be missing. Jan 11, 2017 at 14:35
-
1I second @tgm1024's suggestion of adding a single "Expand All" link on pages that contain hidden comments; being able to quickly search through all answers and comments is very useful. In the meantime, thanks very much for the JavaScript. Rather than opening the Developer Console and pasting the code in each time, a bookmarklet can be created by 1. opening the Bookmark Manager, 2. clicking the More (⋮) icon > "Add new bookmark", 3. entering a name for the bookmarklet, and 4. pasting your JavaScript snippet into the URL field like so:
javascript:$('.js-show-link').trigger('click');
Mar 27, 2018 at 16:57 -
1@Miles I also support the request, I upvoted and said it in my answer, I just give something small that can be used in the meantime. Your suggestion sounds good, you can turn this into a new answer IMO. Mar 28, 2018 at 7:09
-
@MilesWolbe, well to fully clarify, what I actually do want is a single option within the settings for the entire site: "Show all comments, and not ones hand-picked by algorithm", or less clumsy wording to that effect. May 3, 2018 at 12:34
-
Not sure whether this is the right place to ask—if it's not, I'll happily delete—but when I do this, I get the following message in the console: 2D22Fd9oftH.js:108 Uncaught Error: <![EX[["Tried to get element with id of \"%s\" but it is not present on the page",".js-show-link"]]]> TAAL[1] at g (2D22Fd9oftH.js:108) at a (2D22Fd9oftH.js:108) at <anonymous>:1:1 g @ 2D22Fd9oftH.js:108 a [from $-core] @ 2D22Fd9oftH.js:108 (anonymous) @ VM2184:1 Service Worker termination by a timeout timer was canceled because DevTools is attached. Any idea how I can fix this? Nov 4, 2018 at 16:05
-
-
@Joel sorry can't see any error with my code this time. Looks like you try to run this as extension, which it's not. You must run it as plain code in the JS console of Chrome on SE page. Nov 6, 2018 at 11:53
-
-
2This answer is better served with a warning. We don't actually keep all the comments on the page pre-loaded. Every time you click the show more comments button, it sends a request to the server to fetch the full list of comments. This code without any delays has the potential to send 31 requests to the server immediately, which could result in the user getting rate limited for a short time. Jul 10, 2020 at 15:11
-
@animuson thanks, I wasn't aware of that. I've added a delay of half a second between each "click", is that enough? Jul 11, 2020 at 9:39
Create a bookmarklet for @ShadowWizard's handy JavaScript snippet:
Chrome:
- Bookmarks > Bookmark Manager
- Click the More (vertical ellipsis) icon then "Add new bookmark"
- Enter a name for the bookmarklet (e.g., "Expand All") and paste this into the URL field:
javascript:$('.js-show-link').trigger('click');
Firefox:
- Right click Bookmarks Bar > New Bookmark...
- Enter a name for the bookmarklet and paste this into the URL Location field:
javascript:(function(){$('.js-show-link').trigger('click');})();
Safari:
- Cmd + D
- Enter a name for the bookmarklet and click Add
- Right click the bookmark > Edit Address...
- Replace the existing location with
javascript:$('.js-show-link').trigger('click');
-
5This answer is better served with a warning. We don't actually keep all the comments on the page pre-loaded. Every time you click the show more comments button, it sends a request to the server to fetch the full list of comments. This code without any delays has the potential to send 31 requests to the server immediately, which could result in the user getting rate limited for a short time. Jul 10, 2020 at 15:12
-
lots of comments
!=lots of value
.