diff --git a/src/preload/index.ts b/src/preload/index.ts index 85e4910..3ee8047 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -1,5 +1,5 @@ import fs from 'fs' -import { contextBridge, ipcRenderer } from 'electron' +import { contextBridge, ipcRenderer, IpcRenderer } from 'electron' import { domReady } from './utils' import { useLoading } from './loading' @@ -16,6 +16,7 @@ contextBridge.exposeInMainWorld('fs', fs) contextBridge.exposeInMainWorld('removeLoading', removeLoading) contextBridge.exposeInMainWorld('ipcRenderer', { ...ipcRenderer, + // `exposeInMainWorld` will not expose attribute and mothods from the prototype on(...args: Parameters) { return ipcRenderer.on(...args) }