Skip to content

Instantly share code, notes, and snippets.

@hi-ogawa
Last active July 13, 2022 03:09
Show Gist options
  • Save hi-ogawa/7886f36839691c5c079d9dea43ae58f1 to your computer and use it in GitHub Desktop.
Save hi-ogawa/7886f36839691c5c079d9dea43ae58f1 to your computer and use it in GitHub Desktop.
Github PR diff view auto loading
const PREFIX = "xxx";
for (const node of document.querySelectorAll('div[data-targets="diff-file-filter.diffEntries"]')) {
const file = node.getAttribute("data-tagsearch-path");
const button = node.querySelector("button.load-diff-button");
if (button && file.startsWith(PREFIX)) {
button.click();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment