Polish Electron desktop shell

This commit is contained in:
th committed 2026-06-05 17:34:50 +02:00
1 parent 70cf131c47
commit 32cc3ecec3
8 files changed
+249 -8

No files matched your search

+8 -1
View File
@@ -1,4 +1,4 @@
import { contextBridge } from 'electron'
import { contextBridge, ipcRenderer } from 'electron'
contextBridge.exposeInMainWorld('ruwioDesktop', {
platform: process.platform,
@@ -7,4 +7,11 @@ contextBridge.exposeInMainWorld('ruwioDesktop', {
chrome: process.versions.chrome,
node: process.versions.node,
},
onMenuCommand(callback: (command: string) => void) {
const listener = (_event: Electron.IpcRendererEvent, command: string) => callback(command)
ipcRenderer.on('ruwio:menu-command', listener)
return () => {
ipcRenderer.removeListener('ruwio:menu-command', listener)
}
},
})