Skip to content

Fix: set referrerpolicy on embed iframe to prevent Error 153 (fix #51)#52

Open
swashbuck wants to merge 1 commit into
masterfrom
fix/error-153-referrerpolicy
Open

Fix: set referrerpolicy on embed iframe to prevent Error 153 (fix #51)#52
swashbuck wants to merge 1 commit into
masterfrom
fix/error-153-referrerpolicy

Conversation

@swashbuck

Copy link
Copy Markdown
Contributor

Fixes #51

Fix

Testing

  1. Add <meta name="referrer" content="same-origin"> to a course's index.html to simulate a host that restricts its referrer policy.
  2. Load a page with a YouTube component. Without this fix: embed request has no Referer header, YouTube returns Error 153.
  3. With this fix: iframe sends Referer (origin only), embed plays normally. Confirmed via DevTools network inspection — the iframe attribute overrides the document-level policy for that request only, so no other requests are affected.

Posted via collaboration with Claude Code

YouTube's client-identity policy requires the Referer header on
embed requests. Host pages that restrict their referrer policy
(e.g. same-origin) strip it, and YouTube rejects the embed with
Error 153. Setting referrerpolicy="strict-origin-when-cross-origin"
on the iframe overrides the document policy for that request only,
matching YouTube's own recommendation.

Fixes #51
@swashbuck swashbuck changed the title fix: set referrerpolicy on embed iframe to prevent Error 153 Fix: set referrerpolicy on embed iframe to prevent Error 153 (fix #51) Jul 7, 2026
@swashbuck swashbuck self-assigned this Jul 7, 2026
@swashbuck swashbuck moved this from New to Needs Reviewing in adapt_framework: The TODO Board Jul 7, 2026
@swashbuck swashbuck added the bug label Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Needs Reviewing

Development

Successfully merging this pull request may close these issues.

Embed fails with Error 153 when the host page suppresses the Referer header

2 participants