Skip to content

Instantly share code, notes, and snippets.

@KevinBatdorf
Last active March 18, 2024 18:50
Show Gist options
  • Save KevinBatdorf/b398db5086c5065a5054e24b0fa1ae6c to your computer and use it in GitHub Desktop.
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
// 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();
// });
// }
@KevinBatdorf
Copy link
Author

KevinBatdorf commented Apr 28, 2022

Run this in the browser console (devtools) with your comments in view, i.e.

https://www.reddit.com/user/me/comments

https://old.reddit.com/user/me/comments

(refresh as needed)

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