Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions examples/basic-host/src/sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,9 @@ window.addEventListener("message", async (event) => {
inner.setAttribute("allow", allowAttribute);
}
if (typeof html === "string") {
// Use document.write instead of srcdoc for WebGL compatibility.
// srcdoc creates an opaque origin which prevents WebGL canvas updates
// from being displayed properly. document.write preserves the sandbox
// origin, allowing WebGL to work correctly.
// CSP is enforced via HTTP headers on this page (sandbox.html).
const doc = inner.contentDocument || inner.contentWindow?.document;
if (doc) {
doc.open();
doc.write(html);
doc.close();
} else {
// Fallback to srcdoc if document is not accessible
console.warn("[Sandbox] document.write not available, falling back to srcdoc");
inner.srcdoc = html;
}
inner.srcdoc = html;
} else {
console.error("[Sandbox] Missing or invalid HTML content in sandbox-resource-ready notification.");
}
} else {
if (inner && inner.contentWindow) {
Expand Down
325 changes: 0 additions & 325 deletions examples/basic-host/src/tamper-detection.ts

This file was deleted.

6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading