File size: 328 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
const { ipcRenderer, contextBridge } = require( 'electron' );
( async () => {
const config = await ipcRenderer.invoke( 'get-config' );
contextBridge.exposeInMainWorld( 'electron', {
send: ( channel, ...args ) => {
if ( channel === 'secrets' ) {
ipcRenderer.send( channel, ...args );
}
},
config,
} );
} )();
|