Last active
January 6, 2023 23:43
-
-
Save phoebejaffe/99c32a360e45ea5babd322f353879677 to your computer and use it in GitHub Desktop.
Bookmarklet code for opening a github link from a graphite page
This file contains hidden or 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
(()=>{ | |
if (window.location.hostname === 'app.graphite.dev' && window.location.pathname.includes('/github/pr/')) { | |
const pathname = window.location.pathname; | |
const pieces = pathname.replace('/github/pr/', '').split('/'); | |
const githubUrl = `https://github.com/${pieces[0]}/${pieces[1]}/pull/${pieces[2].split('/')[0]}/`; | |
window.open(githubUrl); | |
} | |
} | |
)(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment