Skip to content

Instantly share code, notes, and snippets.

@troy-lamerton
Last active March 8, 2018 13:38
Show Gist options
  • Save troy-lamerton/66190283480559a881e78c32422d904f to your computer and use it in GitHub Desktop.
Save troy-lamerton/66190283480559a881e78c32422d904f to your computer and use it in GitHub Desktop.
run in browser console
// toggle the show/hide for file diffs in github pull requests
// this script hides all files with 'zipkey-icons' in the name
// and the language files
var fileDiffs = document.querySelectorAll('.file-header.js-file-header');
for (const fileDiff of fileDiffs) {
const text = fileDiff.innerText;
if (text.includes('zipkey-icons') || text.includes('/languages')) {
const hideButton = fileDiff.querySelector('.btn-octicon.js-details-target[aria-expanded="true"]');
hideButton && hideButton.click()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment