Skip to content

Instantly share code, notes, and snippets.

@nickv2002
Last active November 11, 2025 19:08
Show Gist options
  • Select an option

  • Save nickv2002/f697a3774917369215f1b81eebee4c67 to your computer and use it in GitHub Desktop.

Select an option

Save nickv2002/f697a3774917369215f1b81eebee4c67 to your computer and use it in GitHub Desktop.
Bookmarklet to switch between GitHub and Graphite PR Pages
javascript:(()=>{const{host,pathname}=location;if(host.includes('github.com')&&pathname.includes('/pull/')){const m=pathname.match(/^\/([^/]+)\/([^/]+)\/pull\/(\d+)(?:\/|$)/);if(m){window.open('https://app.graphite.com/github/pr/'+m[1]+'/'+m[2]+'/'+m[3],'_blank');}else{alert('Could not parse GitHub PR URL.');}}else if((host.includes('app.graphite.com')||host.includes('app.graphite.dev'))&&pathname.includes('/github/pr/')){const m=pathname.match(/^\/github\/pr\/([^/]+)\/([^/]+)\/(\d+)(?:\/|$)/);if(m){window.open('https://github.com/'+m[1]+'/'+m[2]+'/pull/'+m[3],'_blank');}else{alert('Could not parse Graphite PR URL.');}}else{alert('Not a GitHub or Graphite PR URL.');}})();
@nickv2002
Copy link
Author

nickv2002 commented Oct 7, 2025

Create a new bookmark and paste that in as the URL. Call it whatever you want. Mine is Graphite↔GH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment