Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gurdotan/9354907 to your computer and use it in GitHub Desktop.
Save gurdotan/9354907 to your computer and use it in GitHub Desktop.
var interval = setInterval(function() {
var expandPoints = $(".octicon.octicon-unfold");
expandPoints ? expandPoints.click() : clearInterval(interval);
}, 2000);
@mfaux
Copy link

mfaux commented Dec 7, 2017

Hi @gurdotan. Thanks for the snippet. It looks like github is explicitly setting $ to undefined, so here's an update to your script:

var interval = setInterval(function() {
  var anchor = document.querySelector(".diff-expander");
  anchor ?  anchor.click() : clearInterval(interval);
}, 100);

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