From a68d52d5b2f56af1979536922429b5000cfa946d Mon Sep 17 00:00:00 2001 From: Mark Randall Havens Date: Sun, 9 Nov 2025 21:10:31 +0000 Subject: [PATCH] =?UTF-8?q?v3.0.4=20=E2=80=93=20Adaptive=20Frame=20of=20St?= =?UTF-8?q?illness=20Dynamic=20iframe=20resizing=20via=20postMessage=20han?= =?UTF-8?q?dshake.=20Perfect=20centering=20restored.=20Infinite=20recursio?= =?UTF-8?q?n=20made=20visible.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- public/app.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 7f16c0c..f6d9e1b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "the-fold-within", - "version": "3.0.4", + "version": "3.0.5", "dependencies": { "pdf-parse": "^1.1.1" } diff --git a/public/app.js b/public/app.js index 16a00b1..a6fe9ce 100755 --- a/public/app.js +++ b/public/app.js @@ -294,11 +294,15 @@ function renderIframe(rel) { `; doc.head.appendChild(style); - // Inject auto-height script + // Inject auto-height script with debounce const script = doc.createElement("script"); script.textContent = ` + let timeout; function sendHeight() { - window.parent.postMessage({ type: 'resizeFrame', height: document.body.scrollHeight }, '*'); + clearTimeout(timeout); + timeout = setTimeout(() => { + window.parent.postMessage({ type: 'resizeFrame', height: document.body.scrollHeight + 20 }, '*'); + }, 100); } new ResizeObserver(sendHeight).observe(document.body); window.addEventListener('load', sendHeight);