let currentHeight = document.documentElement.scrollHeight;
if (currentHeight === lastHeight) {
clearInterval(timer);
console.log("Reached the bottom or new content is not loading.");
} else {
lastHeight = currentHeight;
}
}, 2000); // 2000 milliseconds (or 2 seconds) between each scroll attempt
}
scrollToBottomOfInfiniteScroll();
그 다음 이를 실행한다.
js
async function delay(ms) { return new Promise((resolve) => setTimeout(resolve, ms));}async function clickAndWaitForFeed(elementToClick) { return new Promise((resolve) => { const feedObserver = new MutationObserver((mutations, observer)
=>
{
for (let mutation of mutations) {
if (mutation.type === "childList" && document.querySelector(".feed")) {