From e15d9308c75894ce31885da3498eb9eec83d9004 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Mon, 18 Mar 2024 21:52:09 -0700 Subject: [PATCH] Directly inject button in RAF loop Fixes issue where the button will not appear if the tab is inactive --- index.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/index.html b/index.html index eadad86..3be59ad 100644 --- a/index.html +++ b/index.html @@ -143,6 +143,7 @@ const currentFrame = Math.floor((timestamp - start) / msPerFrame); if (currentFrame >= frames.length) { asciiContainer.textContent = ascii; + asciiContainer.insertAdjacentElement('beforeend', button) return; } asciiContainer.textContent = frames[currentFrame]; @@ -178,9 +179,6 @@ }); } }); - setTimeout(() => { - asciiContainer.insertAdjacentElement('beforeend', button); - }, msPerFrame * totalFrames + 500); // Inject obfuscated email. To block low-effort scraping. const addr = document.querySelector('address > a'); -- 2.47.3