-
-
Save EsEnZeT/fc84d839716ebdcf3ac6f85dc415b8eb to your computer and use it in GitHub Desktop.
JavaScript to delete all of your Reddit comments
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 https://old.reddit.com/user/<username>/ and paste into your console. | |
// Reddit throttles these actions, hence the 1s timer. | |
let interval = setInterval(() => { | |
let deleteButtons = $('a.togglebutton[data-event-action="delete"]'); | |
if (deleteButtons.length === 0) { | |
clearInterval(interval); | |
if ($('.next-button > a')[0]) { | |
$('.next-button > a')[0].click(); | |
alert('Restart script.'); | |
} | |
} else { | |
deleteButtons[0].click(); | |
setTimeout(() => { | |
$('span.option.error.active > a.yes').click(); | |
}, 300); | |
} | |
}, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment