Skip to content

Commit 7e0872b

Browse files
authored
Create preload.js
1 parent 1e214b9 commit 7e0872b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

preload.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const { contextBridge, ipcRenderer } = require('electron');
2+
3+
contextBridge.exposeInMainWorld('electronApi', {
4+
launchApp: (appName) => ipcRenderer.invoke('launchApp', appName),
5+
systemAction: (action) => ipcRenderer.invoke('systemAction', action),
6+
launchSettings: () => ipcRenderer.invoke('launchSettings'),
7+
audioAction: (action) => ipcRenderer.invoke('audioAction', action),
8+
displayAction: (action) => ipcRenderer.invoke('displayAction', action),
9+
networkAction: (action) => ipcRenderer.invoke('networkAction', action),
10+
powerAction: (profile) => ipcRenderer.invoke('powerAction', profile),
11+
setLanguage: (newLang) => ipcRenderer.invoke('setLanguage', newLang),
12+
selectWifi: (ssid) => ipcRenderer.invoke('selectWifi', ssid),
13+
connectWifi: () => ipcRenderer.invoke('connectWifi'),
14+
scanBluetooth: () => ipcRenderer.invoke('scanBluetooth'),
15+
selectBluetooth: (deviceId) => ipcRenderer.invoke('selectBluetooth', deviceId),
16+
pairBluetooth: () => ipcRenderer.invoke('pairBluetooth'),
17+
closeSettings: () => ipcRenderer.invoke('closeSettings'),
18+
initSettings: () => ipcRenderer.invoke('initSettings')
19+
});

0 commit comments

Comments
 (0)