Skip to content

Commit a911ff4

Browse files
save file
1 parent a6ab37a commit a911ff4

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

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

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,32 @@
333333
`;
334334

335335

336+
var html = `
337+
338+
<script>
339+
window.addEventListener('message',({data})=>{
340+
console.log('message',data);
341+
var {type} = data;
342+
if(type==='run'){
343+
run();
344+
}
345+
346+
});
347+
348+
</scr`+`ipt>
349+
350+
<script>
351+
352+
function run(){
353+
354+
${js}
355+
356+
}//run
357+
358+
</scr`+`ipt>
359+
`;
360+
361+
336362

337363

338364

@@ -370,7 +396,7 @@
370396
clear();
371397
}
372398

373-
iframe.contentWindow.postMessage({js});
399+
iframe.contentWindow.postMessage({type:'run'});
374400

375401
//var result = await win.eval(js);
376402
//resolve(result);

0 commit comments

Comments
 (0)