docs: avoid exposing ipcRenderer in navigation history fiddle (#52882)

Passing the renderer callback directly to ipcRenderer.on leaks
IpcRendererEvent.sender, which violates security guideline 20.

Assisted-By: Cursor Grok 4.6
This commit is contained in:
Mark Skelton authored and GitHub committed 2026-08-22 06:18:52 +00:00
1 parent 0fc95af309
commit cdf93bfa4a
1 file changed
+1 -1
@@ -8,5 +8,5 @@ contextBridge.exposeInMainWorld('electronAPI', {
loadURL: (url) => ipcRenderer.invoke('nav:loadURL', url),
getCurrentURL: () => ipcRenderer.invoke('nav:getCurrentURL'),
getHistory: () => ipcRenderer.invoke('nav:getHistory'),
onNavigationUpdate: (callback) => ipcRenderer.on('nav:updated', callback)
onNavigationUpdate: (callback) => ipcRenderer.on('nav:updated', () => callback())
})