# Multi-composition templates over `file://` Some HTML templates are split into an entry file that pulls in sub-scenes at runtime via a placeholder pattern: ```html
``` The entry's client-side player then `fetch()`es each sub-file and injects it. This works fine when the page is served over HTTP, but **Chromium blocks `fetch()` on `file://` URLs** — so the exact same page loaded over `file://` (as it is for a headless render) produces an empty shell where the scenes should be. The recording captures nothing. ## Fix: inline every sub-scene on the Node side, then load Before `page.goto()`, read the entry HTML from disk, resolve every `data-composition-src` reference, inline them into a `window.__COMPOSITIONS__` map, and inject a small player that mounts each placeholder from that map. Write the result to a sibling `.tmp.html` so any relative asset paths in the compositions still resolve. ```js async function prepareSourceHtml(sourcePath) { const raw = await readFile(sourcePath, 'utf8'); const srcMatches = Array.from(raw.matchAll(/data-composition-src=["']([^"']+)["']/g)); if (srcMatches.length === 0) return { loadPath: sourcePath }; // single-file: no-op const srcDir = dirname(sourcePath); const compMap = {}; for (const m of srcMatches) { const rel = m[1]; if (compMap[rel] !== undefined) continue; const p = join(srcDir, rel); if (existsSync(p)) compMap[rel] = await readFile(p, 'utf8'); } if (Object.keys(compMap).length === 0) return { loadPath: sourcePath }; // Escape `` (and comment openers) so the JSON survives inside tags. const safeJson = JSON.stringify(compMap).replace(/<\//g, '<\\/').replace(/