Skip to content

Instantly share code, notes, and snippets.

@Darep
Created May 30, 2016 07:01
Show Gist options
  • Select an option

  • Save Darep/b33ba3d71f4570760422317aa7bf31f2 to your computer and use it in GitHub Desktop.

Select an option

Save Darep/b33ba3d71f4570760422317aa7bf31f2 to your computer and use it in GitHub Desktop.
Remove all comments from GitHub Pull Request
// Sometimes it's necessary to do a bit of clean-up
Array.prototype.forEach.call(document.querySelectorAll('.js-comment-delete button'), function(el, i) {
el.removeAttribute('data-confirm');
el.click();
});
@druchoo
Copy link
Copy Markdown

druchoo commented Jul 8, 2020

Still works. If you have many comments that are folded, you'll need to expand them first.

@Trijeet
Copy link
Copy Markdown

Trijeet commented Dec 2, 2020

Still works. Thanks.

@mimaty-lifull
Copy link
Copy Markdown

Still works. Thanks.

@kylechadha
Copy link
Copy Markdown

I wanted to resolve ~100 comments and was able to use this:

Array.prototype.forEach.call(document.querySelectorAll('.js-resolvable-timeline-thread-form button'), function(el, i) {
  el.click()
});

@motorto
Copy link
Copy Markdown

motorto commented Oct 27, 2025

unfortunately no longer working ... :(

@shimonenator
Copy link
Copy Markdown

I wanted to resolve ~100 comments and was able to use this:

Array.prototype.forEach.call(document.querySelectorAll('.js-resolvable-timeline-thread-form button'), function(el, i) {
  el.click()
});

It still works, but you have to load all comments first by clicking load more

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