File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed
utils/editors/js-console/html/output-console/v2.0 Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change 282282 js = '(async()=>{\n' + js + '\n})()' ;
283283 }
284284
285- iframe = document . createElement ( 'iframe' ) ;
286- obj . iframe = iframe ;
287- iframe . sandbox = 'allow-scripts allow-same-origin' ;
285+
288286 var html = `
289287 <script>
290288
291- ${ js }
292-
289+
293290 </scr` + `ipt>
294291 ` ;
295- var url = window . URL . createObjectURL ( new Blob ( [ html ] , { type :'text/html' } ) ) ;
296- iframe . src = url ;
297- iframe . onload = onload ;
292+
293+
294+ iframe = document . createElement ( 'iframe' ) ;
295+ obj . iframe = iframe ;
296+ iframe . sandbox = 'allow-scripts allow-same-origin' ;
297+ var blob = new Blob ( [ html ] , { type :'text/html' } ) ;
298+ var url = window . URL . createObjectURL ( blob ) ;
299+ iframe . src = url ;
300+ iframe . onload = onload ;
298301 cur . root . append ( iframe ) ;
299302
300303 return promise ;
322325 }
323326
324327
325- // var result = await win.eval(js);
326- // resolve(result);
328+ var result = await win . eval ( js ) ;
329+ resolve ( result ) ;
327330
328- // iframe.remove();
331+ iframe . remove ( ) ;
329332
330333 } //onload
331334
You can’t perform that action at this time.
0 commit comments