Created
September 21, 2022 19:08
-
-
Save mbakgun/1376ef78aea571fdbe7dee88e6c9c385 to your computer and use it in GitHub Desktop.
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
for (var i = 100; i >= 0; i--) { | |
const changes = document.querySelector("#diffs > div.files.d-flex.gl-mt-2 > div.diff-tree-list.js-diff-tree-list.gl-px-5 > div.tree-list-holder.d-flex.flex-column > div.tree-list-scroll.pt-0.tree-list-blobs") | |
for (const child of changes.children) { | |
for (const baby of child.children) { | |
if (baby.getAttribute("viewed-files") != null) { | |
var greenCount = (baby.querySelector("div > div > span.file-row-stats.mr-1 > span.cgreen").textContent.trim()).replace('+', ''); | |
var redCount = (baby.querySelector("div > div > span.file-row-stats.mr-1 > span.cred").textContent.trim()).replace('-', ''); | |
if (greenCount == '0' && redCount == '0') { | |
baby.parentNode.removeChild(baby); | |
if (child.childElementCount == 1) { | |
child.parentNode.removeChild(child); | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment