Merge pull request #37 from GodofRabbit/dev-ipcrender

Add `ipcRrenderer.on` to `exposeInMainWorld.ipcRenderer` for this use in Renderer-process.
This commit is contained in:
草鞋没号 2021-11-25 18:57:43 +08:00 committed by GitHub
commit eb09eac617
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,5 +13,10 @@ domReady().then(() => {
// --------- Expose some API to Renderer process. ---------
contextBridge.exposeInMainWorld('fs', fs)
contextBridge.exposeInMainWorld('ipcRenderer', ipcRenderer)
contextBridge.exposeInMainWorld('removeLoading', removeLoading)
contextBridge.exposeInMainWorld('ipcRenderer', {
...ipcRenderer,
on(...args: Parameters<IpcRenderer['on']>) {
return ipcRenderer.on(...args)
}
})