-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreload.js
29 lines (28 loc) · 1.58 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
const { contextBridge, ipcRenderer } = require('electron');
contextBridge.exposeInMainWorld('electronAPI', {
getCPUInfo: () => ipcRenderer.invoke('get-cpu-info'),
shutdown: () => ipcRenderer.invoke('shutdown-system'),
restart: () => ipcRenderer.invoke('restart-system'),
signout: () => ipcRenderer.invoke('sign-out-system'),
sleep: () => ipcRenderer.invoke('sleep-system'),
envvariables: () => ipcRenderer.invoke('open-env-variables'),
openterminal: () => ipcRenderer.invoke('open-cmd'),
opensetting: () => ipcRenderer.invoke('open-settings'),
opencalculator: () => ipcRenderer.invoke('open-calculator'),
checksystemupdate: () => ipcRenderer.invoke('check-system-update'),
installedapplications: () => ipcRenderer.invoke('get-installed-programs'),
screenkeyboard: () => ipcRenderer.invoke('open-screen-keyboard'),
systemmute: () => ipcRenderer.invoke('mute-audio'),
systemunmute: () => ipcRenderer.invoke('unmute-audio'),
systemlighttheme: () => ipcRenderer.invoke('switch-to-light-theme'),
systemdarktheme: () => ipcRenderer.invoke('switch-to-dark-theme'),
reportbug: () => ipcRenderer.invoke('report-bug'),
systemscreenshot: () => ipcRenderer.invoke('take-screenshot'),
opennotepad: () => ipcRenderer.invoke('open-notepad'),
openbrowser: () => ipcRenderer.invoke('open-browser'),
openclock: () => ipcRenderer.invoke('open-clock'),
openmap: () => ipcRenderer.invoke('open-maps'),
opencalendar: () => ipcRenderer.invoke('open-calendar'),
opentaskmanager: () => ipcRenderer.invoke('open-taskmanager'),
openfileexplorer: () => ipcRenderer.invoke('open-file-explorer'),
});