-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpreload.js
More file actions
16 lines (15 loc) · 697 Bytes
/
preload.js
File metadata and controls
16 lines (15 loc) · 697 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const { contextBridge, ipcRenderer } = require('electron');
contextBridge.exposeInMainWorld('API', {
sendNotification: (title, body) => ipcRenderer.send('show-notification', title, body),
openDevTools: () => ipcRenderer.send('open-dev-tools'),
on: (channel, func) => ipcRenderer.on(channel, func),
send: (channel, ...args) => ipcRenderer.send(channel, ...args),
removeListener: (channel, func) => ipcRenderer.removeListener(channel, func),
openThemeEditor: () => ipcRenderer.send('open-theme-editor'),
versions: {
node: () => process.versions.node,
chrome: () => process.versions.chrome,
electron: () => process.versions.electron,
iotanotepad: () => "1.2.2"
},
});