Skip to content

Instantly share code, notes, and snippets.

@jportella93
Created March 10, 2020 17:05
Show Gist options
  • Save jportella93/fc6876ea9d7eee7105a14e71cc2ce8a4 to your computer and use it in GitHub Desktop.
Save jportella93/fc6876ea9d7eee7105a14e71cc2ce8a4 to your computer and use it in GitHub Desktop.
Collapses all expanded diffs of .svg files in a github PR.
Array.from(document.querySelectorAll(".file-info"))
.filter(node => node.textContent.includes('.svg'))
.forEach(el => {
const btn = el.querySelector('.js-details-target');
if (btn.getAttribute('aria-expanded') === "true") btn.click();
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment