File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,21 +20,18 @@ function unwrapFunctionCode(fn) {
2020injectScript (
2121 unwrapFunctionCode ( function ( ) {
2222 const devtoolsKey = "@pbkit/devtools" ;
23- let resolve ;
24- const devtoolsConfigPromise = new Promise ( ( res ) => ( resolve = res ) ) ;
2523 if ( ! window [ devtoolsKey ] ) {
26- window [ devtoolsKey ] = [ resolve ] ;
24+ window [ devtoolsKey ] = [ register ] ;
2725 } else if ( Array . isArray ( window [ devtoolsKey ] ) ) {
28- window [ devtoolsKey ] . push ( resolve ) ;
26+ window [ devtoolsKey ] . push ( register ) ;
2927 } else {
30- resolve ( window [ devtoolsKey ] ) ;
28+ register ( window [ devtoolsKey ] ) ;
3129 }
32- devtoolsConfigPromise . then ( ( devtoolsConfig ) => {
30+ function register ( devtoolsConfig ) {
3331 devtoolsConfig . on ( "*" , ( event , type ) => {
3432 const message = { target : "@pbkit/devtools/panel" , event, type } ;
3533 window . postMessage ( message , "*" ) ;
3634 } ) ;
37- console . log ( "Successfully connected with @pbkit/devtools/panel" ) ;
38- } ) ;
35+ }
3936 } )
4037) ;
You can’t perform that action at this time.
0 commit comments