Skip to content

Instantly share code, notes, and snippets.

@frankcalise
Created May 24, 2023 11:53
Show Gist options
  • Save frankcalise/01441e8b30136272adfc3fed69fa0686 to your computer and use it in GitHub Desktop.
Save frankcalise/01441e8b30136272adfc3fed69fa0686 to your computer and use it in GitHub Desktop.
Expand GH PR
// for really long PR pages, execute this function to auto press "Load more" until done
function expandPR()
{
var loadMore = document.querySelector('.ajax-pagination-btn');
if (loadMore.length !== 0)
{
console.log('Clicking all these "Load more": ' + loadMore.length);
loadMore.click();
setTimeout(expandPR, 500);
return;
}
loadMore = document.querySelector('.ajax-pagination-btn:visible:contains(Loading)');
if (loadMore.length !== 0)
{
console.log('"Load more... " are loading: ' + loadMore.length);
setTimeout(expandPR, 500);
return;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment