function loadAllTransactions() { return new Promise((resolve, reject) => { let lastHeight = 0; const maxAttempts = 20; let attempts = 0; const scrollInterval = setInterval(() => { // Scroll to bottom of the page window.scrollTo(0, document.body.scrollHeight); // Wait a moment for new content to load setTimeout(() => { const currentHeight = document.body.scrollHeight; // If no new content loaded if (currentHeight === lastHeight) { attempts++; // Stop if we've made max attempts or no new content if (attempts >= maxAttempts) { clearInterval(scrollInterval); resolve(); } } else { // Reset attempts if new content found attempts = 0; } lastHeight = currentHeight; }, 1000); }, 1500); }); } // Execute and log loadAllTransactions().then(() => { console.log('All transactions loaded'); });
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter