Last active
July 29, 2024 14:26
-
-
Save DV8FromTheWorld/928caef2c92ad089ffb41e404bd4b510 to your computer and use it in GitHub Desktop.
JS Bookmark to move from a blob branch to the main trunk of git repo on github.
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
;(() => { | |
const url = location.href; | |
if (!url.includes('github.com/discord/discord')) { | |
alert("Not on github.com/discord/discord. Not prepared to move to main branch"); | |
return; | |
} | |
if (!url.includes("blob/")) { | |
alert("Not on a git blob/ path."); | |
return; | |
} | |
const updatedUrl = url.replace(/blob\/.*?\//, "tree/main/"); | |
location.href = updatedUrl; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment