-
Notifications
You must be signed in to change notification settings - Fork 11
/
preload.js
26 lines (24 loc) · 922 Bytes
/
preload.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
const { contextBridge, ipcRenderer } = require("electron");
contextBridge.exposeInMainWorld("mspring_theme", {
updateStyle: (callback) => ipcRenderer.on(
"LiteLoader.mspring_theme.updateStyle",
callback
),
rendererReady: () => ipcRenderer.send(
"LiteLoader.mspring_theme.rendererReady"
),
getSettings: () => ipcRenderer.invoke(
"LiteLoader.mspring_theme.getSettings"
),
setSettings: content => ipcRenderer.invoke(
"LiteLoader.mspring_theme.setSettings",
content
),
logToMain: (...args) => ipcRenderer.invoke(
"LiteLoader.mspring_theme.logToMain",
...args
),
openWeb: (url) => ipcRenderer.send("LiteLoader.mspring_theme.openWeb", url),
fetchData: (url) => ipcRenderer.invoke("LiteLoader.mspring_theme.fetchData", url),
readFile: (path) => ipcRenderer.invoke("LiteLoader.mspring_theme.readFile", path),
});