15

When a Q+A page (such as this or that) has many comments, the page is shortened via hiding comments that has lower weight (or whatever). You have those "show <n> more comments" clickables.

Is there an url get query parameter-value pair (eg., hypothetically, ?showAllComments=1) that would make all comments displayed right when it loads? (on the base html page)?

Motivation: may vary, but one example is that some questions induce relevant discussion sometimes outlining slightly differing solutions. When you wanna take such discussions offline eg. to read while traveling, it would be practical to save a snapshot with all the comments.

1

1 Answer 1

3

You could use javascript for that.

var expandLinks = document.getElementsByClassName('js-add-link comments-link');
for (var i = 0; i < expandLinks.length; i++) expandLinks[i].click();

You can usually run javascript simply by inputting javascript:alert(0); into the address bar.

Another option is to use GreaseMonkey or one of its alternatives to inject that javascript into SO pages and always have all comments visible, just like magic.

2
  • 1
    For easy copy+paste into address bar: javascript:for (var i = 0; i < document.getElementsByClassName('js-add-link comments-link').length; i++) document.getElementsByClassName('js-add-link comments-link')[i].click(); Feb 3, 2018 at 12:20
  • 1
    Or shorter: javascript:for(x of document.getElementsByClassName('js-add-link comments-link'))x.click()
    – SimpleVar
    Feb 5, 2018 at 22:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .