MCPcopy Index your code
hub / github.com/browserless/browserless / scrollDown

Function scrollDown

src/utils.ts:668–678  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

666
667 return new Promise((resolve) => {
668 function scrollDown() {
669 window.scrollBy(0, scrollStep);
670
671 if (document.body.scrollHeight - bottomPos() < bottomThreshold) {
672 window.scrollTo(0, 0);
673 setTimeout(resolve, 500);
674 return;
675 }
676
677 setTimeout(scrollDown, scrollInterval);
678 }
679
680 scrollDown();
681 });

Callers 1

scrollThroughPageFunction · 0.85

Calls 1

bottomPosFunction · 0.85

Tested by

no test coverage detected