Fix iframes in Safari PWA

This commit is contained in:
Zef Hemel
2023-10-09 21:02:57 +02:00
parent 17ba536801
commit dc255c3dda
2 changed files with 7 additions and 2 deletions
+3 -1
View File
@@ -23,8 +23,10 @@ async function init() {
try {
const result = await syscall("widget.render", lang, body);
const iframe = document.createElement("iframe");
iframe.srcdoc = panelHtml; // set as a global
iframe.src = "about:blank";
iframe.onload = () => {
iframe.contentDocument.write(panelHtml);
iframe.contentWindow.postMessage({
type: "html",
theme: document.getElementsByTagName("html")[0].getAttribute(