Forked from MichaelLawton/deleteAmazonSavedItems.js
Last active
May 13, 2021 18:52
-
-
Save arbal/1d20cdfc0a74a55176c6da0c03e14474 to your computer and use it in GitHub Desktop.
Moves all Amazon saved for later items on the cart page to a private Wish List named "Saved For Later". It will only moves 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.
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
| function moveSavedItemsToWishList() { | |
| var query = document.querySelectorAll("#sc-saved-cart input[value='Move to Wish List']") | |
| if (query.length) { | |
| query[0].click(); | |
| console.log("after move item click") | |
| var wl = document.querySelectorAll("a[aria-label='Saved For Later (Private,item)']"); | |
| if (wl.length) { | |
| wl[0].click(); | |
| } | |
| console.log("after wishlist click") | |
| } | |
| if (query.length > 1) { | |
| setTimeout(moveSavedItemsToWishList,5000); | |
| } | |
| else { | |
| console.log('Finished'); | |
| } | |
| } | |
| moveSavedItemsToWishList(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment