From 4c95ec2ec403c355dbe118477e48e593b0512101 Mon Sep 17 00:00:00 2001
From: Samuel Newman <mozzius@protonmail.com>
Date: Sat, 13 Apr 2024 12:44:37 +0100
Subject: add ref_src (#3532)

---
 bskyembed/src/components/link.tsx | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'bskyembed/src/components/link.tsx')

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()}
-- 
cgit 1.4.1

