Hacker News new | ask | show | jobs
by techx 1110 days ago
I use a bookmarklet that works on old.reddit.com for both comments and posts, it only removes the current page though

javascript:(function()%7B%2F%2F%20Shreddit%0Alet%20interval%20%3D%20setInterval(()%20%3D%3E%20%7B%0A%20%20%20%20let%20deleteButtons%20%3D%20%24('a.togglebutton%5Bdata-event-action%3D%22delete%22%5D')%3B%0A%20%20%20%20if%20(deleteButtons.length%20%3D%3D%3D%200)%20%7B%0A%20%20%20%20%20%20%20%20clearInterval(interval)%3B%0A%20%20%20%20%20%20%20%20if%20(%24('.next-button%20%3E%20a')%5B0%5D)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%24('.next-button%20%3E%20a')%5B0%5D.click()%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20alert('Restart%20script.')%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20%20%20deleteButtons%5B0%5D.click()%3B%0A%20%20%20%20%20%20%20%20setTimeout(()%20%3D%3E%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%24('span.option.error.active%20%3E%20a.yes').click()%3B%0A%20%20%20%20%20%20%20%20%7D%2C%20300)%3B%0A%20%20%20%20%7D%0A%7D%2C%201000)%3B%7D)()%3B

1 comments

Here is a sanitizer script that uses nothing but javascript

https://github.com/ryanford/Reddit-History-Sanitizer/blob/ma...

Open a tab, login to your account and go to your account page aka reddit.com/u/usernamehere (you likely need old.reddit version of your account, its all I use). Install tampermonkey and the script into that… It will iterate through your comments, overwrite them, then delete and refresh the page as it goes.

Change the line here:

const age = 7

to

const age = -1

To delete all comments. You can adjust that number (in days) to how old you it to filter for comments.