Skip to content

Instantly share code, notes, and snippets.

@s-shin
Created January 15, 2018 05:26
Show Gist options
  • Save s-shin/63d0c47f9f80c9bcbfbbb9cad0fc1d00 to your computer and use it in GitHub Desktop.
Save s-shin/63d0c47f9f80c9bcbfbbb9cad0fc1d00 to your computer and use it in GitHub Desktop.
Bookmarklet for changing the location of per code view page in github to the one of latest commit.
{
const sha = document.querySelector(".commit-tease-sha");
if (sha) {
location.href = location.href.replace(/blob\/[^/]+/, `blob/${sha.textContent.trim()}`);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment