Skip to content

Instantly share code, notes, and snippets.

@conatus
Forked from MichaelLawton/deleteAmazonSavedItems.js
Created November 26, 2022 09:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save conatus/48cdc67c6f0c2e9991fc26f3359cd671 to your computer and use it in GitHub Desktop.
Save conatus/48cdc67c6f0c2e9991fc26f3359cd671 to your computer and use it in GitHub Desktop.
Removes all Amazon saved for later 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 deleteSavedItems() {
var query = document.querySelectorAll("#sc-saved-cart input[value=Delete]");
if (query.length) {
query[0].click();
}
if (query.length > 1) {
setTimeout(deleteSavedItems,100);
}
else {
console.log('Finished');
}
}
deleteSavedItems();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment