Skip to content

Commit 9531cc4

Browse files
committed
GitHub: load >50 commits (fix #5)
1 parent 8bc8a11 commit 9531cc4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

github.com/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ onBrowse(async () => {
1919
btns.appendChild(a);
2020
}
2121
} else if (/\/compare\//.test(location.pathname)) {
22+
const getCommits = () =>
23+
document.querySelectorAll(
24+
"#commits_bucket .Details:not(.branch-action-item)",
25+
);
2226
let attempts = 0;
2327
let commits;
2428
do {
25-
commits = document.querySelectorAll(
26-
"#commits_bucket .Details:not(.branch-action-item)",
27-
);
29+
commits = getCommits();
2830
if (commits.length > 0) {
2931
break;
3032
} else {
@@ -37,6 +39,7 @@ onBrowse(async () => {
3739
const gen = document.createElement("button");
3840
gen.textContent = `Show ${commits.length} commits`;
3941
gen.onclick = () => {
42+
commits = getCommits();
4043
const all = Array.from(commits).map((node) => {
4144
const inner = node.querySelector("p");
4245
return inner.textContent.trim().replace(/[\s\n]+$/g, "");

0 commit comments

Comments
 (0)