File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed
utils/editors/js-console/html/output-console/v2.0 Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change 396396
397397
398398
399+
400+
399401 iframe = document . createElement ( 'iframe' ) ;
400402 obj . iframe = iframe ;
401403 document . body . append ( iframe )
406408 var blob = new Blob ( [ html ] , { type :'text/html' } ) ;
407409 var url = window . URL . createObjectURL ( blob ) ;
408410 iframe . onload = onload ;
409- iframe . src = url ;
411+ iframe . srcdoc = '' ;
410412 //cur.root.append(iframe);
411413
412414 return promise ;
413415
414416
415417 async function onload ( ) {
416418
417- //setTimeout(complete,100);
418-
419- //}//onload
420-
421-
422- //async function complete(){
423-
424419 var win = iframe . contentWindow ;
425420
426421 win . focus ( ) ;
435430
436431 iframe . contentWindow . postMessage ( { js} , '*' ) ;
437432
438- // var result = await win.eval(js);
439- // resolve(result);
433+ var result = await win . eval ( js ) ;
434+ resolve ( result ) ;
440435
441- // iframe.remove();
436+ iframe . remove ( ) ;
442437
443438 } //onload
444439
You can’t perform that action at this time.
0 commit comments