Created
March 10, 2020 17:05
-
-
Save jportella93/fc6876ea9d7eee7105a14e71cc2ce8a4 to your computer and use it in GitHub Desktop.
Collapses all expanded diffs of .svg files in a 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
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