Created
June 30, 2022 11:02
-
-
Save matti/52e4bbcaabb339ba5577e4e00d32380d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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