Skip to content

Instantly share code, notes, and snippets.

@rwbot
Last active October 17, 2023 03:16
Show Gist options
  • Save rwbot/e1512e9ceeaaa6391587466b258a40a6 to your computer and use it in GitHub Desktop.
Save rwbot/e1512e9ceeaaa6391587466b258a40a6 to your computer and use it in GitHub Desktop.
Move all Amazon cart items to "Save for Later"

Open Chrome Developer Console, WIN Ctrl+Shift+J or MAC Cmd+Opt+J, paste and enter

function saveAllAmazonCartItemsForLater() {
  var query = document.querySelectorAll("#activeCartViewForm input[value='Save for later']")
  console.log('started');

  if (query.length) {
    console.log('query.length = ' + query.length);
    query[0].click();
  }
  if (query.length > 1) {
    console.log('query.length = ' + query.length);
    setTimeout(saveAllAmazonCartItemsForLater,100);
  }
  else {
    console.log('Finished');
  }
}

saveAllAmazonCartItemsForLater();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment