import { connectToParent } from 'penpal' ; const methods = { setManifestProbeUrl ( url ) { if ( url ) { localStorage . setItem ( 'manifestUrl' , url ) ; } } , getManifestProbeUrl ( ) { return localStorage . getItem ( 'manifestUrl' ) ; } , probeExtensionInfo ( ) { return new Promise ( ( resolve ) => { let resolved = false ; setTimeout ( ( ) => { if ( ! resolved ) { resolve ( null ) ; } } , 500 ) ; if ( chrome && chrome . runtime ) { const payload = { event : 'detectInstall' } ; chrome . runtime . sendMessage ( 'pcnhielddaaanlfkifllbjahdbndndea' , payload , ( response ) => { console . log ( 'Received response from extension' , response ) ; resolve ( response ) ; resolved = true ; } ) ; } else { resolve ( null ) ; resolved = true ; } } ) ; } , } ; connectToParent ( { debug : true , methods , } ) ;