From b9afe7917e1ce76b8cef1f856d3a035eaf9acddc Mon Sep 17 00:00:00 2001 From: Florian <45694132+flo-bit@users.noreply.github.com> Date: Mon, 1 Jun 2026 15:09:24 +0200 Subject: [PATCH] fix youtube embeds --- eslint.config.mjs | 3 +++ src/lib/strings/embed-player.ts | 9 +++++---- web/iframe/youtube.html | 19 ++++++++++++++++++ web/iframe/youtube.js | 35 +++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 web/iframe/youtube.html create mode 100644 web/iframe/youtube.js diff --git a/eslint.config.mjs b/eslint.config.mjs index 50ab8e5da4b..71b82acb16c 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -30,6 +30,9 @@ export default defineConfig( '.husky/**', 'patches/**', '*.html', + // Eurosky fork: static iframe player scripts (browser globals like YT / + // onYouTubeIframeAPIReady, not app code). Mirrors the bskyweb/** ignore. + 'web/iframe/**', 'bskyweb/**', 'bskyembed/**', 'bskyogcard/**', diff --git a/src/lib/strings/embed-player.ts b/src/lib/strings/embed-player.ts index f1014c4dcb8..921f666ae00 100644 --- a/src/lib/strings/embed-player.ts +++ b/src/lib/strings/embed-player.ts @@ -5,10 +5,11 @@ import {IS_WEB} from '#/env' const {height: SCREEN_HEIGHT} = Dimensions.get('window') const IFRAME_HOST = IS_WEB - ? // @ts-ignore only for web - window.location.host === 'localhost:8100' - ? 'http://localhost:8100' - : 'https://bsky.app' + ? // @ts-ignore only for web -- Eurosky fork: serve the YouTube iframe player + // from our own origin instead of bsky.app. bsky.app/iframe/* sends + // X-Frame-Options: SAMEORIGIN, so it refuses to be framed cross-origin. The + // player files live in web/iframe/* and are copied to the web build root. + window.location.origin : __DEV__ && !process.env.JEST_WORKER_ID ? 'http://localhost:8100' : 'https://bsky.app' diff --git a/web/iframe/youtube.html b/web/iframe/youtube.html new file mode 100644 index 00000000000..483f5f5280a --- /dev/null +++ b/web/iframe/youtube.html @@ -0,0 +1,19 @@ + + +