-
Notifications
You must be signed in to change notification settings - Fork 3
/
preload-main.js
35 lines (33 loc) · 1.27 KB
/
preload-main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
'use strict'
const { ipcRenderer, contextBridge } = require('electron')
/* understand/
* Bridge between the renderer and the main process
*/
contextBridge.exposeInMainWorld("show", {
settings: () => ipcRenderer.invoke("show-settings"),
trouble: () => ipcRenderer.invoke("trouble"),
})
contextBridge.exposeInMainWorld("get", {
logname : () => ipcRenderer.invoke("get-logname"),
taskname: act => ipcRenderer.invoke("get-taskname", act),
taskchat: (t,s) => ipcRenderer.invoke("get-taskchat",t,s),
plugins: url => ipcRenderer.invoke("get-plugins", url),
})
contextBridge.exposeInMainWorld("set", {
users: uis => ipcRenderer.invoke("set-users", uis),
userips: uips => ipcRenderer.invoke("set-userips", uips),
puppetShow: show => ipcRenderer.invoke("set-puppetShow", show),
pageTimeout: t => ipcRenderer.invoke("set-timeout", t),
})
contextBridge.exposeInMainWorld("clear", {
browsers: () => ipcRenderer.invoke("clear-browsers"),
})
contextBridge.exposeInMainWorld("x", {
cute: (a,t) => ipcRenderer.invoke("x-cute", { a, t }),
it: () => ipcRenderer.invoke("x-it"),
cute2: t => ipcRenderer.invoke("x-cute-again", t),
})
contextBridge.exposeInMainWorld("add", {
tasks: t => ipcRenderer.invoke("add-tasks", t),
sent: tasks => ipcRenderer.invoke("add-sent", tasks),
})