commit 7453ceb17725da5cfca914ab6c4ba758f63f8b4c
parent 9d3a858cb2cff9352ae194c40b277f1f05d2da50
Author: Hunter
Date: Wed, 16 Jul 2025 18:54:12 -0400
ensure html structure exists before injecting fullscreen toggle button
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/index.html b/index.html
@@ -230,7 +230,10 @@
// Write HTML directly to iframe document
const doc = preview.contentDocument || preview.contentWindow.document;
doc.open();
- doc.write(code);
+
+ // Ensure we have a proper HTML document structure for the button
+ const htmlContent = code.trim() || '<!DOCTYPE html><html><head></head><body></body></html>';
+ doc.write(htmlContent);
// Inject CSS to disable overscroll and add fullscreen toggle styles
const style = doc.createElement('style');