Skip to content

Instantly share code, notes, and snippets.

@UniqueName12345
Created October 28, 2024 07:32
Show Gist options
  • Select an option

  • Save UniqueName12345/78ab08dfa9c32759975ff242a24083d0 to your computer and use it in GitHub Desktop.

Select an option

Save UniqueName12345/78ab08dfa9c32759975ff242a24083d0 to your computer and use it in GitHub Desktop.
takes the handle and redirects to it. most of the time, it just redirects back to bsky anyway but sometimes it can lead you to their website in case it's never directly linked
const url = new URL(window.location.href);
const isBskyUrl = url.hostname === "bsky.app"
if (isBskyUrl) {
const handle = url.pathname.split("/")[2];
window.location.href = `${handle}`;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment