Skip to content

Instantly share code, notes, and snippets.

@stella3d
Last active July 25, 2018 06:20
Show Gist options
  • Save stella3d/76adf13b450ea0b2255bd5d184e43d88 to your computer and use it in GitHub Desktop.
Save stella3d/76adf13b450ea0b2255bd5d184e43d88 to your computer and use it in GitHub Desktop.
Hide *.meta & *.asset files, and load large diffs by default
const filesContainer = document.querySelector('div#files');
filesContainer.querySelectorAll('div.js-details-container').forEach(div => {
let fileHeader = div.querySelector('div.file-header');
let filePath = fileHeader.getAttribute('data-path');
let isMetaFile = filePath.endsWith('.meta');
let isDotAssetFile = filePath.endsWith('.asset');
let shouldHide = isMetaFile || isDotAssetFile;
let loadDiffButton = div.querySelector('button.load-diff-button');
if(loadDiffButton != null && !shouldHide) {
loadDiffButton.click();
}
if(shouldHide) {
div.style.display = 'none';
}
});
@stella3d
Copy link
Author

stella3d commented Jul 25, 2018

Paste this into the console when on the /files page of your pull request.

This may break when GitHub changes things.

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