Created
December 31, 2024 10:27
-
-
Save erikras/b31fbf7bee90495423f3b9f0a939dfd0 to your computer and use it in GitHub Desktop.
Code to modify github's "Files changed" tab to "hide whitespace"
This file contains hidden or 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
setTimeout(() => { | |
const tabs = [...document.querySelectorAll(".tabnav-tab.flex-shrink-0")] | |
const filesTab = tabs.find((element) => /.+\/files$/.test(element.href)) | |
if (!filesTab) { | |
return | |
} | |
const filesURL = new URL(filesTab.href) | |
filesURL.searchParams.set("w", "1") | |
filesTab.href = filesURL.toString() | |
}, 500) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment