electron/docs/fiddles/features/dark-mode/preload.js
2023-01-02 11:02:15 +01:00

6 lines
220 B
JavaScript

const { contextBridge, ipcRenderer } = require('electron')
contextBridge.exposeInMainWorld('darkMode', {
toggle: () => ipcRenderer.invoke('dark-mode:toggle'),
system: () => ipcRenderer.invoke('dark-mode:system')
})