Skip to content

Instantly share code, notes, and snippets.

@lhayhurst
Last active May 19, 2019 15:30
Show Gist options
  • Save lhayhurst/0f21ab3e9125fc96cf21f2ad8f735984 to your computer and use it in GitHub Desktop.
Save lhayhurst/0f21ab3e9125fc96cf21f2ad8f735984 to your computer and use it in GitHub Desktop.
gc
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
for(var i = 0; i < 100000; i++) { btn = document.getElementById("wishlist-submit"); if ( btn.disabled == false ) { btn.click(); console.log("wishlist-submit button pressed!"); break; } else { await sleep(1); if ( i% 1000 == 0 ) { console.log(i/1000 + " seconds have elapsed"); } } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment