diff --git a/src/preload/index.ts b/src/preload/index.ts index 4a2231e..85e4910 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -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) { + return ipcRenderer.on(...args) + } +})