I would really appreciate this feature. For now, here's a recursive user script that works for me:
function loadAllComments() {
let needRescheduling = false;
const buttons = Array.from(document.querySelectorAll('button'));
buttons.forEach((button) => {
if (button.classList.contains('ajax-pagination-btn')) {
if(!button.hasAttribute('disabled') && button.innerText === 'Load more…') {
console.log("found", button);
needRescheduling = true;
button.dispatchEvent(new MouseEvent('click', {
bubbles: true,
cancelable: true
}));
}
else if(button.hasAttribute('disabled') && button.innerText === 'Loading…') {
console.log("waiting", button);
needRescheduling = true;
}
else {
console.log("unrecognized 'Load more' button", button);
}
}
});
if (needRescheduling) {
setTimeout(loadAllComments, 200)
}
else {
console.log("all comments loaded");
}
}
loadAllComments();
Here's a version that also expands "Show resolved" comments:
function loadAllCommentsAndShowResolved() {
let needRescheduling = false;
const elems = Array.from(document.querySelectorAll('button, .btn-link.Details-content--closed'));
elems.forEach((elem) => {
if (elem.classList.contains('ajax-pagination-btn')) {
if (!elem.hasAttribute('disabled') && elem.innerText === 'Load more…') {
console.log("found", elem);
needRescheduling = true;
elem.dispatchEvent(new MouseEvent('click', {
bubbles: true,
cancelable: true
}));
}
else if (elem.hasAttribute('disabled') && elem.innerText === 'Loading…') {
console.log("waiting", elem);
needRescheduling = true;
}
else {
console.log("unrecognized 'Load more' button", elem);
}
}
else if (elem.classList.contains('Details-content--closed') && elem.innerText === 'Show resolved') {
elem.dispatchEvent(new MouseEvent('click', {
bubbles: true,
cancelable: true
}));
}
});
if (needRescheduling) {
setTimeout(loadAllCommentsAndShowResolved, 200)
}
else {
console.log("all comments loaded");
}
}
loadAllCommentsAndShowResolved();