Skip to content

Instantly share code, notes, and snippets.

@shaykalyan
Created December 8, 2024 00:25
Show Gist options
  • Save shaykalyan/cb31609776bcaea7cf1cf00519bb4bf7 to your computer and use it in GitHub Desktop.
Save shaykalyan/cb31609776bcaea7cf1cf00519bb4bf7 to your computer and use it in GitHub Desktop.
safeway-coupon-clip bookmarklet
// 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