Skip to content

Instantly share code, notes, and snippets.

@tanvirraj
Created March 20, 2022 04:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanvirraj/1d9e118cceb4aae8f66ef37ce5a40ec9 to your computer and use it in GitHub Desktop.
Save tanvirraj/1d9e118cceb4aae8f66ef37ce5a40ec9 to your computer and use it in GitHub Desktop.
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