Skip to content

Instantly share code, notes, and snippets.

@harunsmrkovic
Created June 27, 2018 16:19
Show Gist options
  • Save harunsmrkovic/6865fda2e6507851407e1dbc4ff2c572 to your computer and use it in GitHub Desktop.
Save harunsmrkovic/6865fda2e6507851407e1dbc4ff2c572 to your computer and use it in GitHub Desktop.
Hide all snapshot diffs in GitHub PR
(function() {
const FILES_TO_HIDE = 'snapshots'
if (window.location.href.includes('/pull/') && window.location.href.includes('/files')) {
Array.from(document.querySelectorAll('.file-header'))
.filter(node => node.querySelector('.file-info > a').outerText.includes(FILES_TO_HIDE))
.forEach(node => node.parentNode.querySelector('.file-actions .js-details-target').click())
}
})()
@harunsmrkovic
Copy link
Author

You can use this with CJS for Chrome to auto-collapse certain files when viewing PR diff.

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