Created
June 27, 2018 16:19
-
-
Save harunsmrkovic/6865fda2e6507851407e1dbc4ff2c572 to your computer and use it in GitHub Desktop.
Hide all snapshot diffs in GitHub PR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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()) | |
} | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use this with CJS for Chrome to auto-collapse certain files when viewing PR diff.