Skip to content

Instantly share code, notes, and snippets.

@haridsv
Created July 21, 2020 07:38
Show Gist options
  • Save haridsv/6b902e3d1a5eb4f4496ef517d56b1f93 to your computer and use it in GitHub Desktop.
Save haridsv/6b902e3d1a5eb4f4496ef517d56b1f93 to your computer and use it in GitHub Desktop.
Expand all the comments made by the current user (handles only those that are part of a review submission).
var currentUser = document.querySelector(".user-profile-link").href.replace(/.*\//, "")
document.querySelectorAll("div.js-comment.js-targetable-comment.js-updatable-content").forEach(function(n) {
var authorNode = n.parentNode.querySelector(".author");
if (authorNode && authorNode.textContent == currentUser) {
n.parentNode.querySelectorAll(".js-toggle-outdated-comments").forEach(n => n.click());
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment