-
Notifications
You must be signed in to change notification settings - Fork 1
/
preload.js
41 lines (40 loc) · 1.19 KB
/
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const { contextBridge, ipcRenderer } = require("electron");
contextBridge.exposeInMainWorld("purlfy", {
onStatisticsChange: (callback) => ipcRenderer.on(
"LiteLoader.purlfy.statisticsChange",
callback
),
onLambdaEnabledChange: (callback) => ipcRenderer.on(
"LiteLoader.purlfy.lambdaEnabledChange",
callback
),
onTempDisableChange: (callback) => ipcRenderer.on(
"LiteLoader.purlfy.tempDisableChange",
callback
),
reloadRules: () => ipcRenderer.send(
"LiteLoader.purlfy.reloadRules"
),
setLambdaEnabled: (lambdaEnabled) => ipcRenderer.send(
"LiteLoader.purlfy.setLambdaEnabled",
lambdaEnabled
),
setTempDisable: (tempDisable) => ipcRenderer.send(
"LiteLoader.purlfy.setTempDisable",
tempDisable
),
toggle: (name, enabled) => ipcRenderer.invoke(
"LiteLoader.purlfy.toggle",
name, enabled
),
updateRules: () => ipcRenderer.invoke(
"LiteLoader.purlfy.updateRules"
),
getInfo: () => ipcRenderer.invoke(
"LiteLoader.purlfy.getInfo"
),
purify: (url) => ipcRenderer.invoke(
"LiteLoader.purlfy.purify",
url
),
});