Skip to content

fix(captions): avoid GSAP SRI mismatch in previews#2233

Open
miguel-heygen wants to merge 1 commit into
mainfrom
fix/embedded-caption-preview-sri
Open

fix(captions): avoid GSAP SRI mismatch in previews#2233
miguel-heygen wants to merge 1 commit into
mainfrom
fix/embedded-caption-preview-sri

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

Prevent embedded-caption previews from silently rejecting the locally intercepted GSAP bundle when the composition pins a different CDN version with SRI.

Why

preview-frames.cjs serves local GSAP bytes for CDN script requests, but the original integrity hash remained on the script tag. If the local package version differed, Chrome rejected the response and the timeline never registered.

How

  • Intercept the preview document and remove integrity/crossorigin only from GSAP script tags.
  • Preserve SRI attributes on every unrelated script.
  • Continue serving the discovered local GSAP bundle for offline-safe previews.
  • Add a focused regression test and make the helper importable without launching preview dependencies.

Test plan

  • node --test skills/embedded-captions/scripts/preview-frames.test.cjs
  • bunx oxfmt --check skills/embedded-captions/scripts/preview-frames.cjs skills/embedded-captions/scripts/preview-frames.test.cjs
  • bunx oxlint skills/embedded-captions/scripts/preview-frames.cjs skills/embedded-captions/scripts/preview-frames.test.cjs
  • bun run lint:skills

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant