Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

player: runtime-src is honoured for srcdoc only - an src embed always fetches the runtime from jsDelivr

Aperta
#4,003 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@srikarsunchu ci sta già lavorando.

Dal 21/9/2026.

  • #4246 di @srikarsunchu — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
frontend, web-dev

Direzione di ricerca

Start with the player entry points H, F, Pt, and _injectRuntime in hyperframes-player.global.js, then reproduce the src path using host.html and comp-nested.html. Done means an src embed requests /local-runtime.js when runtime-src is valid and otherwise retains the jsDelivr fallback, matching srcdoc behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

triage/needs-triage
Summary

<hyperframes-player> accepts a runtime-src attribute, and validates it carefully (http/https,
same-origin or loopback). But it is only ever read on the srcdoc path:

function H(r, e) { return qe(It(e, ...), Pt(r)); }   // srcdoc  -> honours runtime-src (Pt)
function F(r, e) { return Lt(e, ...); }              // src     -> URL params only

The probe that injects the runtime into an src iframe uses the module constant instead, with no
access to the host element:

var k = "https://cdn.jsdelivr.net/npm/@hyperframes/[email protected]/dist/hyperframe.runtime.iife.js";
_injectRuntime() {
  this._runtimeInjected = true;
  const t = doc.createElement("script");
  t.src = k;                       // <- always the CDN
  (doc.head || doc.documentElement).appendChild(t);
}

So an src embed cannot be given a local runtime. On an offline or air-gapped machine, or behind
a script-src 'self' CSP, the injection silently fails (it is inside a bare try {} catch {}),
__hf never appears, and the element eventually emits
error: "Composition timeline not found after 8s".

Reproduction

comp-nested.html — a [data-composition-src] child makes the probe inject immediately:

<!doctype html><html><head><meta charset="utf-8"></head><body>
  <div id="root" data-composition-id="main" data-width="1080" data-height="1920">
    <div data-composition-src="child.html" data-start="0" data-duration="5"></div>
  </div>
</body></html>

host.html, served over http from the same origin as a local copy of the runtime:

<script src="https://cdn.jsdelivr.net/npm/@hyperframes/[email protected]/dist/hyperframes-player.global.js"></script>
<hyperframes-player src="comp-nested.html" runtime-src="/local-runtime.js"
                    width="1080" height="1920"></hyperframes-player>
Actual

The network panel shows

GET https://cdn.jsdelivr.net/npm/@hyperframes/[email protected]/dist/hyperframe.runtime.iife.js  200

and no request for /local-runtime.js. runtime-src passes the element's own validation and is
still ignored.

Expected

src and srcdoc resolve the runtime the same way: runtime-src when it is set and valid, the
jsDelivr default otherwise. Concretely, pass the resolved URL into the probe (it is already
computed by Pt(host)) instead of closing over the module constant, so an embed can serve its own
pinned copy.

Two smaller things that would help either way:

  • the injected <script> has no onerror, so a blocked or 404 runtime is indistinguishable from
    a slow one — the element just times out after 8 s with a message about the timeline;
  • documenting runtime-src as srcdoc-only would at least make the current behaviour discoverable.
Environment
  • @hyperframes/player 0.8.41, Chromium 141, Linux
Why it matters

A local review tool that embeds staged projects has to reach a CDN for every composition it opens,
or pre-inject the runtime into the served HTML itself (which is what we now do) — even though the
exact matching runtime is already sitting in node_modules/hyperframes/dist/.

Lingua principale
TypeScript
Stelle
54.1k
Fork
4.9k
Merge medio
7h 18m
PR unite (30g)
784

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di heygen-com/hyperframes

Tutte le issue di heygen-com/hyperframes

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.