Skip to content

Commit e66c708

Browse files
save file
1 parent 826c38d commit e66c708

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

utils/editors/js-console/html/output-console/v2.0/output-console-v2.0.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,30 @@
298298
`;
299299

300300

301+
var html = `
302+
303+
<script type="module">
304+
window.addEventListener("message", async (event) => {
305+
try {
306+
// Wrap the code in a module so dynamic import works
307+
const blob = new Blob([event.data.js], { type: "text/javascript" });
308+
const url = URL.createObjectURL(blob);
309+
await import(url);
310+
URL.revokeObjectURL(url);
311+
} catch (e) {
312+
console.error("Module error:", e);
313+
}
314+
});
315+
</scr`+`ipt>
316+
317+
318+
`;
319+
320+
321+
322+
323+
324+
301325
iframe = document.createElement('iframe');
302326
obj.iframe = iframe;
303327
iframe.sandbox = 'allow-scripts allow-same-origin';

0 commit comments

Comments
 (0)