File tree Expand file tree Collapse file tree 1 file changed +17
-13
lines changed
Expand file tree Collapse file tree 1 file changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -50,18 +50,22 @@ export async function createWindow({
5050 iframe . setAttribute ( 'src' , uri ) ;
5151 document . body . appendChild ( iframe ) ;
5252
53- iframe . addEventListener ( 'load' , ( ) => {
54- if ( iframe . contentWindow ) {
55- resolve ( iframe . contentWindow ) ;
56- } else {
57- // We don't know of a case when this would happen, but better to fail
58- // fast if it does.
59- reject (
60- new Error (
61- `iframe.contentWindow not present on load for job "${ id } ".` ,
62- ) ,
63- ) ;
64- }
65- } ) ;
53+ iframe . addEventListener (
54+ 'load' ,
55+ ( ) => {
56+ if ( iframe . contentWindow ) {
57+ resolve ( iframe . contentWindow ) ;
58+ } else {
59+ // We don't know of a case when this would happen, but better to fail
60+ // fast if it does.
61+ reject (
62+ new Error (
63+ `iframe.contentWindow not present on load for job "${ id } ".` ,
64+ ) ,
65+ ) ;
66+ }
67+ } ,
68+ { once : true } ,
69+ ) ;
6670 } ) ;
6771}
You can’t perform that action at this time.
0 commit comments