Skip to content

Instantly share code, notes, and snippets.

@3lvis
Forked from AliSoftware/GHDiff-HidePods.js
Last active February 13, 2017 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 3lvis/aed420e45e40acc127dd10e78a9dcdaf to your computer and use it in GitHub Desktop.
Save 3lvis/aed420e45e40acc127dd10e78a9dcdaf to your computer and use it in GitHub Desktop.
Hide Pods/* related files in a GitHub diff page
// When you are in the diff page of a GitHub PR
// And want to hide all the Pods/* files in that diff page, use this:
// Paste that in your Web Inspector's console
var nodes = document.evaluate("//div[@class='file-header' and starts-with(@data-path,'Carthage/')]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null );
for(i=0; i<nodes.snapshotLength; ++i) {
nodes.snapshotItem(i).parentNode.hidden = true
}
// Or even better, create a bookmark with this code for easy quick access:
javascript:var nodes = document.evaluate("//div[@class='file-header' and starts-with(@data-path,'Carthage/')]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null ); for(i=0; i<nodes.snapshotLength; ++i) { nodes.snapshotItem(i).parentNode.hidden = true }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment