about summary refs log tree commit diff
path: root/bskyembed
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-04-13 12:44:37 +0100
committerGitHub <noreply@github.com>2024-04-13 12:44:37 +0100
commit4c95ec2ec403c355dbe118477e48e593b0512101 (patch)
tree978ec1aecab48c4359f7036dba79a0896dd45707 /bskyembed
parent9fb20915e890be0993c15ad19b59105b78cf8f12 (diff)
downloadvoidsky-4c95ec2ec403c355dbe118477e48e593b0512101.tar.zst
add ref_src (#3532)
Diffstat (limited to 'bskyembed')
-rw-r--r--bskyembed/src/components/link.tsx7
-rw-r--r--bskyembed/src/screens/landing.tsx2
2 files changed, 7 insertions, 2 deletions
diff --git a/bskyembed/src/components/link.tsx b/bskyembed/src/components/link.tsx
index 7226ecf3d..db752542b 100644
--- a/bskyembed/src/components/link.tsx
+++ b/bskyembed/src/components/link.tsx
@@ -8,9 +8,14 @@ export function Link({
   href: string
   className?: string
 } & h.JSX.HTMLAttributes<HTMLAnchorElement>) {
+  const newSearchParam = new URLSearchParams()
+  newSearchParam.set('ref_src', 'embed')
+
   return (
     <a
-      href={href.startsWith('http') ? href : `https://bsky.app${href}`}
+      href={`${
+        href.startsWith('http') ? href : `https://bsky.app${href}`
+      }?${newSearchParam.toString()}`}
       target="_blank"
       rel="noopener noreferrer nofollow"
       onClick={evt => evt.stopPropagation()}
diff --git a/bskyembed/src/screens/landing.tsx b/bskyembed/src/screens/landing.tsx
index 0c5508935..72612db0e 100644
--- a/bskyembed/src/screens/landing.tsx
+++ b/bskyembed/src/screens/landing.tsx
@@ -242,7 +242,7 @@ function Snippet({thread}: {thread: AppBskyFeedDefs.ThreadViewPost}) {
 }
 
 function toShareUrl(path: string) {
-  return `https://bsky.app${path}`
+  return `https://bsky.app${path}?ref_src=embed`
 }
 
 /**