diff --git a/package.json b/package.json index 0a449ba3..60493249 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yattie", - "version": "0.5.4", + "version": "0.5.5", "engines": { "npm": ">=8.0.0 <9.0.0", "node": ">=16.0.0 <17.0.0" diff --git a/src/preload.js b/src/preload.js index fca1e9a5..29626007 100644 --- a/src/preload.js +++ b/src/preload.js @@ -6,10 +6,15 @@ contextBridge.exposeInMainWorld("ipc", { return await ipcRenderer.invoke(channel, data); }, on: (channel, func) => { + // Remove any old listeners + ipcRenderer.removeAllListeners(channel); // Strip event as it includes `sender` and is a security risk ipcRenderer.on(channel, (event, ...args) => func(...args)); }, clearCache: () => { webFrame.clearCache(); }, + eventNames: () => { + return ipcRenderer.eventNames(); + }, });