Skip to content

Instantly share code, notes, and snippets.

@matti
Created June 30, 2022 11:02
Show Gist options
  • Save matti/52e4bbcaabb339ba5577e4e00d32380d to your computer and use it in GitHub Desktop.
Save matti/52e4bbcaabb339ba5577e4e00d32380d to your computer and use it in GitHub Desktop.
javascript:(function(){
let tryAttempts = 0;
function loadComments () {
let needRescheduling = false;
const buttons = document.querySelectorAll(".ajax-pagination-btn[data-disable-with]")
buttons.forEach((button) => {
button.click();
needRescheduling = true;
tryAttempts = 0;
})
if (needRescheduling || tryAttempts < 5) {
if (needRescheduling) {
console.log("Loading comments.")
} else {
console.log("Looking for more to load.");
}
tryAttempts++;
setTimeout(loadComments, 500)
} else {
console.log("All comments loaded.");
const resolvedButtons = document.querySelectorAll(".js-toggle-outdated-comments[data-view-component]");
resolvedButtons.forEach((button) => {
button.click();
})
console.log("All resolved comments loaded.")
}
loadComments()
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment