-
-
Save peterflynn/5980273 to your computer and use it in GitHub Desktop.
// DEPRECATED: See "Expand All Comments" at https://gist.github.com/peterflynn/ace5dd3d7a8ec645cd42 for | |
// a more up to date, maintained version of this. | |
// Original bookmarklet from this gist (does not work anymore): | |
// javascript:(function() { $(".outdated-diff-comment-container").addClass("open"); }()); | |
// Newer, working version (from link above as of Jan 2017): | |
// javascript:(function() { document.querySelectorAll(".outdated-diff-comment-container").forEach(function(n) {n.classList.add("open")}) }()); |
@Garrett-R see this issue.
https://support.mozilla.org/ja/questions/970761
And as a bookmarklet:
javascript:(function() {var interval = setInterval(function() { var expandPoints = $(".octicon.octicon-unfold"); expandPoints ? expandPoints.click() : clearInterval(interval); }, 2000);}())
I think this stopped working. Doesn't look like github loads jQuery anymore, or at least $
isn't bound to it. I rewrote this in pure javascript and it works:
javascript:(function() {
elements = document.getElementsByClassName("outdated-diff-comment-container");
for (var i=0; i<elements.length; i++) { elements[i].className += " open"; }
}());
Not sure if there's a better way (I'm not a JS guy).
@jessejoe worked for me, thanks!
The class name for the container has since changed to outdated-comment
.
Updated version:
javascript:Array.from(document.getElementsByClassName('outdated-comment')).forEach(l => l.classList.add('open'));
Thanks to yuichiro-yoshida's comment at https://coderwall.com/p/akdgoq/expand-all-outdated-diff-comments-in-a-github-pull-request
Updated version:
javascript: Array.from(document.getElementsByClassName('outdated-diff-comment-container'))
.concat(Array.from(document.getElementsByClassName('outdated-comment')))
.forEach(l => l.classList.add('open'));
Detail:
https://coderwall.com/p/akdgoq/expand-all-outdated-diff-comments-in-a-github-pull-request
In case you are interested: This was recently implemented in the browser extension sindresorhus/refined-github
Updated JS bookmark for recent Github redesign:
javascript:Array.from(document.getElementsByClassName('outdated-comment')).forEach(l => l.setAttribute('open',true));
I followed Firefox's instruction to install a bookmarklet to install this one, then I ran it on this PR and it doesn't seem to do anything...
This would be really useful to me, so I'm really hoping I can get it working.