Last active
March 18, 2024 18:50
-
-
Save KevinBatdorf/b398db5086c5065a5054e24b0fa1ae6c to your computer and use it in GitHub Desktop.
While on the comments page, put this in the console. May need to refresh a few times depending on how many you have
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
// Go to the old.reddit.com site | |
for (const dltbtn of document.querySelectorAll('[data-event-action="delete"]')) { | |
dltbtn.click(); | |
await new Promise(requestAnimationFrame); | |
dltbtn.closest('form')?.querySelector('.yes')?.click() | |
await new Promise(r => setTimeout(r, 300)); | |
} | |
// No longer works | |
// for (const dotdotdot of document.querySelectorAll('[aria-label*=more ]')) { | |
// requestAnimationFrame(() => { | |
// dotdotdot.click(); | |
// document.querySelector('button .icon-delete').click(); | |
// document.querySelector('[aria-modal] footer button:nth-child(2)').click(); | |
// }); | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run this in the browser console (devtools) with your comments in view, i.e.
https://www.reddit.com/user/me/commentshttps://old.reddit.com/user/me/comments
(refresh as needed)