File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -95,9 +95,17 @@ window.addEventListener("message", async (event) => {
9595 inner . setAttribute ( "allow" , allowAttribute ) ;
9696 }
9797 if ( typeof html === "string" ) {
98- inner . srcdoc = html ;
99- } else {
100- console . error ( "[Sandbox] Missing or invalid HTML content in sandbox-resource-ready notification." ) ;
98+ // Use document.write instead of srcdoc (which the CesiumJS Map won't work with)
99+ const doc = inner . contentDocument || inner . contentWindow ?. document ;
100+ if ( doc ) {
101+ doc . open ( ) ;
102+ doc . write ( html ) ;
103+ doc . close ( ) ;
104+ } else {
105+ // Fallback to srcdoc if document is not accessible
106+ console . warn ( "[Sandbox] document.write not available, falling back to srcdoc" ) ;
107+ inner . srcdoc = html ;
108+ }
101109 }
102110 } else {
103111 if ( inner && inner . contentWindow ) {
You can’t perform that action at this time.
0 commit comments