From 34e060cb1c2ca75a832925e7654bf902fc78c437 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Thu, 27 Aug 2026 10:18:04 +0200 Subject: [PATCH] Export: don't let a detached iframe frame block a slide capture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixImages only rewrites basePath-less img srcs; on slides embedding cross-origin iframes its page.evaluate can hit a permanently detached child frame and fail all three capture attempts. Swallow that error — the screenshot itself still retries. Co-Authored-By: Claude Fable 5 --- scripts/export-pdf.mjs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/export-pdf.mjs b/scripts/export-pdf.mjs index 6d4cd0f..43886e1 100644 --- a/scripts/export-pdf.mjs +++ b/scripts/export-pdf.mjs @@ -200,7 +200,14 @@ async function main() { let shot; for (let attempt = 1; attempt <= 3; attempt++) { try { - await fixImages(page); + // fixImages only rewrites basePath-less srcs; on slides with + // cross-origin iframes its evaluate can hit a permanently detached + // child frame, so a failure here must not block the screenshot. + try { + await fixImages(page); + } catch { + // ignore — live-iframe slides have no basePath images to fix + } await hideNav(page); await new Promise((r) => setTimeout(r, 200)); shot = await page.screenshot({ type: "png", encoding: "base64" });