Add offWindowFocus method to electronAPI

This commit is contained in:
2026-04-17 08:01:01 +02:00
parent 3f4f0c9475
commit a83486107c

View File

@@ -15,5 +15,6 @@ contextBridge.exposeInMainWorld('electronAPI', {
const url = event.currentTarget.href;
ipcRenderer.send('open-external-link', url);
},
onWindowFocus: (callback) => ipcRenderer.on('window-focused', callback)
onWindowFocus: (callback) => ipcRenderer.on('window-focused', callback),
offWindowFocus: (callback) => ipcRenderer.removeListener('window-focused', callback),
})