From 832b162a6d44feb97cf7b07e6911843c0cbec80b Mon Sep 17 00:00:00 2001 From: David Stone Date: Thu, 21 May 2026 23:47:36 -0600 Subject: [PATCH] fix: add iframe document fallback to avoid silently skipping iOS patch - Reuse existing iframe reference instead of re-querying DOM - Add contentWindow?.document fallback for iOS compatibility - Ensures iOS patch runs reliably on all platforms Resolves #1249 --- assets/js/template-previewer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/template-previewer.js b/assets/js/template-previewer.js index 837f66ae..68db214a 100644 --- a/assets/js/template-previewer.js +++ b/assets/js/template-previewer.js @@ -74,8 +74,8 @@ loadingIndicator.style.display = "none"; } if (isIOS()) { - const iframeEl = document.getElementById("iframe"); - const body = iframeEl && iframeEl.contentDocument ? iframeEl.contentDocument.body : null; + const iframe_doc = (iframe == null ? void 0 : iframe.contentDocument) || (iframe == null ? void 0 : iframe.contentWindow == null ? void 0 : iframe.contentWindow.document); + const body = iframe_doc ? iframe_doc.body : null; body == null ? void 0 : body.classList.add("wu-fix-safari-preview"); (body == null ? void 0 : body.style) && Object.assign(body.style, { position: "fixed",