From 46f3b39faefb8f5bc2c8d70c705c822bf3834bfa Mon Sep 17 00:00:00 2001 From: Echo Date: Thu, 4 Dec 2025 17:27:20 +0100 Subject: [PATCH] Fixes YouTube embeds (#37126) --- app/javascript/mastodon/features/status/components/card.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/javascript/mastodon/features/status/components/card.tsx b/app/javascript/mastodon/features/status/components/card.tsx index c6e0c1655aa..d060d35c2cd 100644 --- a/app/javascript/mastodon/features/status/components/card.tsx +++ b/app/javascript/mastodon/features/status/components/card.tsx @@ -48,8 +48,10 @@ const handleIframeUrl = (html: string, url: string, providerName: string) => { iframeUrl.searchParams.set('autoplay', '1'); iframeUrl.searchParams.set('auto_play', '1'); - if (startTime && providerName === 'YouTube') - iframeUrl.searchParams.set('start', startTime); + if (providerName === 'YouTube') { + iframeUrl.searchParams.set('start', startTime ?? ''); + iframe.referrerPolicy = 'strict-origin-when-cross-origin'; + } iframe.src = iframeUrl.href;