Created
December 8, 2024 00:25
-
-
Save shaykalyan/cb31609776bcaea7cf1cf00519bb4bf7 to your computer and use it in GitHub Desktop.
safeway-coupon-clip bookmarklet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// stole this from somewhere a while ago | |
javascript:(function(){function sleep(ms){return new Promise(resolve=>setTimeout(resolve,ms));}async function click(){for(var loadMoreButton=document.getElementsByClassName("btn load-more")[0];loadMoreButton!==undefined;){loadMoreButton.click();loadMoreButton=document.getElementsByClassName("btn load-more")[0];await sleep(500);}var actionButtons=document.querySelectorAll('loyalty-card-action-buttons');for(var i=0;i<actionButtons.length;i++){var button=actionButtons[i].querySelector('button');if(button)button.click();}}click();}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment