Saturday, December 7, 2024

Amazon: Delete all "items saved for later"

## Instructions for Deleting Saved Items from Amazon Cart in Firefox ##

1. **Open Your Amazon Cart**  
   Launch Firefox and navigate to your Amazon Cart.

2. **Access Developer Tools**
 
   - Right-click anywhere on the page.
   - Select **Inspect** from the context menu.

3. **Switch to the Console Tab**  

   Click on the **Console** tab within the Developer Tools panel.

4. **Prepare to Execute JavaScript**  
   Type `allow to paste` in the console to enable pasting code.

5. **Copy and Paste the JavaScript Function**
 
   Copy the following code snippet and paste it into the console:

   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');
       }
   }

  

6. **Execute the Function**  
   To start deleting saved items, type `deleteSavedItems();` in the console and press **Enter**.

7. **Repeat as Necessary**  
   If there are more items to delete, you can run `deleteSavedItems();` again until all desired items are removed.

### Additional Notes ###
- Ensure that you scroll through your saved items first to make any additional items visible before executing the script. 

- Confirm that this method is still functional as of October 15, 2023, based on user feedback.

- To revert `allow to paste`, open about:config, and reset devtools.selfxss.count


No comments: