Skip to content

Instantly share code, notes, and snippets.

@dzg
Last active January 25, 2024 20:41
Show Gist options
  • Save dzg/0cfe22c496355f20ab6ff24dd00848f3 to your computer and use it in GitHub Desktop.
Save dzg/0cfe22c496355f20ab6ff24dd00848f3 to your computer and use it in GitHub Desktop.
"Saves for later" all Amazon cart items on the cart page. It will only remove visible items. You might want to scroll first to make more items visible. To use paste code in developer console (Ctrl+Shift+J or Cmd+Opt+J in Chrome) then press enter.
function saveAllItemsForLater() {
var query = document.querySelectorAll("input[data-action='save-for-later']");
var last = query[query.length-1]
if (query.length) { last.click(); }
if (query.length > 1) { setTimeout(saveAllItemsForLater, 100); }
else { console.log('Finished'); }
}
saveAllItemsForLater();
@dzg
Copy link
Author

dzg commented Jul 30, 2021

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