Skip to content

Instantly share code, notes, and snippets.

@Xiphe
Last active June 8, 2016 07:35
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 Xiphe/706993bb496a27baa095 to your computer and use it in GitHub Desktop.
Save Xiphe/706993bb496a27baa095 to your computer and use it in GitHub Desktop.

Remove /bower_components/ from github diff

Array.prototype.forEach.call(document.querySelectorAll('[title*="/bower_components/"]'), function(node){
  node.parentNode.parentNode.parentNode.remove();
});

Bookmarklet can be found after this link: http://xiphe.net/remove_bower_components_bookmarklet.html
(github removes href attributes when they contain javascript)

@christian-meyer-jimdo
Copy link

Since Github does not have jquery any more, this is not working any longer.

Here is a vanilla version:

Array.prototype.forEach.call(document.querySelectorAll('[title*="/bower_components/"]'), function(node){
  node.parentNode.parentNode.parentNode.remove();
});

@Xiphe
Copy link
Author

Xiphe commented Jun 8, 2016

Great @christian-meyer-jimdo! I updated it to use your code <3

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