Created
January 5, 2022 10:04
-
-
Save spilist/86124b69b622ef1e9497994e6c4162f0 to your computer and use it in GitHub Desktop.
Revisions
-
spilist created this gist
Jan 5, 2022 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ javascript: let count = 0; let elemtnsLength = 0; function loadAllCommentsAndShowResolved() { let e = !1; let elements = Array.from( document.querySelectorAll("button, .btn-link.Details-content--closed") ); elementsLength = elements.length; elements.forEach((o) => { o.classList.contains("ajax-pagination-btn") ? o.hasAttribute("disabled") || "Load more…" !== o.innerText ? o.hasAttribute("disabled") && "Loading…" === o.innerText ? (console.log("waiting", o), (e = !0)) : console.log("unrecognized %27Load more%27 button", o) : (console.log("found", o), (e = !0), o.dispatchEvent( new MouseEvent("click", { bubbles: !0, cancelable: !0 }) )) : o.classList.contains("Details-content--closed") && "Show resolved" === o.innerText && o.dispatchEvent( new MouseEvent("click", { bubbles: !0, cancelable: !0 }) ); count++; }), e ? setTimeout(loadAllCommentsAndShowResolved, 200) : () => {}; } function moveToDiscussion() { if (location.hash === '') { return; } if (count !== elemtnsLength) { setTimeout(moveToDiscussion, 200); } let x = document.querySelector(location.hash); if (x) { x.closest('details').scrollIntoView(); document.scrollingElement.scrollTop -= 70; } } loadAllCommentsAndShowResolved(); setTimeout(moveToDiscussion, 500);