Skip to content

Instantly share code, notes, and snippets.

@phoebejaffe
Last active January 6, 2023 23:43
Show Gist options
  • Save phoebejaffe/99c32a360e45ea5babd322f353879677 to your computer and use it in GitHub Desktop.
Save phoebejaffe/99c32a360e45ea5babd322f353879677 to your computer and use it in GitHub Desktop.
Bookmarklet code for opening a github link from a graphite page
(()=>{
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