-
Notifications
You must be signed in to change notification settings - Fork 0
/
preload.js
52 lines (41 loc) · 1.27 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
42
43
44
45
46
47
48
49
50
51
52
const { contextBridge, ipcRenderer } = require('electron');
contextBridge.exposeInMainWorld('bgEngine', {
getBackgrounds: () => {
try {
return ipcRenderer.invoke('getBackgrounds');
} catch (error) {
console.error(error);
throw error;
}
},
getValorantPath: () => {
return ipcRenderer.invoke('getValorantPath');
},
getBackgroundEngineFolder: () => {
return ipcRenderer.invoke('backgroundEngineFolder');
},
getVideosFolder: () => {
return ipcRenderer.invoke('videosFolder');
},
setGameBackground: (game, video_path) => {
return ipcRenderer.invoke('setGameBackground', game, video_path);
},
setDatabase: (key, value) => {
return ipcRenderer.invoke('setDatabase', key, value);
},
getDatabase: (key) => {
return ipcRenderer.invoke('getDatabase', key);
},
fileExists: (filePath) => {
return ipcRenderer.invoke('fileExists', filePath);
},
deleteFile: (filePath) => {
return ipcRenderer.invoke('deleteFile', filePath);
},
downloadFile: (url) => {
return ipcRenderer.invoke('downloadFile', url);
},
openExplorer: () => {
return ipcRenderer.invoke('openExplorer');
}
});