Created
March 20, 2022 04:11
-
-
Save tanvirraj/1d9e118cceb4aae8f66ef37ce5a40ec9 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
function githubFirstCommitsPage() { | |
let el = document.querySelector('.repository-content'); | |
let commits = el.querySelector('[aria-label^=Commits]'); | |
let base = commits.closest('a').href; | |
let count = commits.previousElementSibling | |
.textContent | |
.trim() | |
.replace(/[^\d\.\-]/g, ""); | |
count = count-36; | |
let sha = el | |
.querySelector('[data-test-selector="commit-tease-commit-message"]') | |
.href | |
.split('/'); | |
sha = sha[sha.length-1]; | |
window.location = `${base}?after=${sha}+${count}`; | |
} | |
githubFirstCommitsPage(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment