Skip to content

Instantly share code, notes, and snippets.

@JohnStarich
Last active October 3, 2023 12:09
Show Gist options
  • Save JohnStarich/2aaee401387966f31d595260687106c8 to your computer and use it in GitHub Desktop.
Save JohnStarich/2aaee401387966f31d595260687106c8 to your computer and use it in GitHub Desktop.
Load all collapsed GitHub comments
javascript:(function() {
/*
To use this bookmarklet, create a new bookmark in your browser and paste
the entire contents of this file into the URL address box.
*/
let emptyMillis = 0;
const delayMillis = 250;
const interval = setInterval(() => {
const elems = document.querySelectorAll('.pagination-loader-container button[type="submit"]');
if (elems.length === 0) {
emptyMillis += delayMillis;
} else {
emptyMillis = 0;
elems[0].scrollIntoView({ behavior: 'smooth' }); /* This helps us see progress. 'instant' resulted in forward and backward jumps, which was weird. */
}
elems.forEach(e => e.click());
if (emptyMillis > 5000) {
clearInterval(interval);
}
}, delayMillis);
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment