Created
January 5, 2022 10:04
-
-
Save spilist/86124b69b622ef1e9497994e6c4162f0 to your computer and use it in GitHub Desktop.
github 모든 resolved comments 열고, 코멘트 이동 가능한 상태면 해당 코멘트로 이동하는 bookmaklet
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: 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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://gist.github.com/agamm/ea65f0510e65e67f65eca189d55ee32b 에서 코드 가져와서 일부 수정