Skip to content

Commit cd24034

Browse files
save file
1 parent e4734f1 commit cd24034

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

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

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -341,27 +341,17 @@
341341
<head>
342342
343343
<script>
344-
window.addEventListener('message',({data})=>{
345-
console.log('message',data);
346-
var {type} = data;
347-
if(type==='run'){
348-
run();
349-
}
344+
window.addEventListener('message',async({data})=>{
345+
346+
var {js} = data;
347+
var blob = new Blob([js],{type:'text/javascript'});
348+
var url = window.URL.createObjectURL(blob);
349+
await import(url);
350350
351351
});
352352
353353
</scr`+`ipt>
354354
355-
<script type=module>
356-
357-
window.run=function(){
358-
359-
${js}
360-
361-
}//run
362-
363-
</scr`+`ipt>
364-
365355
</head>
366356
367357
<body>

0 commit comments

Comments
 (0)