Skip to content

Commit ba550f1

Browse files
authored
fix: follow-up to PR #234 (remove accidental file, revert from document.write to equiv. srcdoc) (#248)
* chore: remove tamper-detection.ts (not meant to be submitted) Follow-up to PR #234. This file was accidentally included. * revert to srcdoc Follow-up to PR #234 per domfarolino's review feedback. * regen * regen
1 parent 9a9ecf2 commit ba550f1

File tree

3 files changed

+6
-343
lines changed

3 files changed

+6
-343
lines changed

examples/basic-host/src/sandbox.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -95,21 +95,9 @@ window.addEventListener("message", async (event) => {
9595
inner.setAttribute("allow", allowAttribute);
9696
}
9797
if (typeof html === "string") {
98-
// Use document.write instead of srcdoc for WebGL compatibility.
99-
// srcdoc creates an opaque origin which prevents WebGL canvas updates
100-
// from being displayed properly. document.write preserves the sandbox
101-
// origin, allowing WebGL to work correctly.
102-
// CSP is enforced via HTTP headers on this page (sandbox.html).
103-
const doc = inner.contentDocument || inner.contentWindow?.document;
104-
if (doc) {
105-
doc.open();
106-
doc.write(html);
107-
doc.close();
108-
} else {
109-
// Fallback to srcdoc if document is not accessible
110-
console.warn("[Sandbox] document.write not available, falling back to srcdoc");
111-
inner.srcdoc = html;
112-
}
98+
inner.srcdoc = html;
99+
} else {
100+
console.error("[Sandbox] Missing or invalid HTML content in sandbox-resource-ready notification.");
113101
}
114102
} else {
115103
if (inner && inner.contentWindow) {

examples/basic-host/src/tamper-detection.ts

Lines changed: 0 additions & 325 deletions
This file was deleted.

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)