-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
preload.js
31 lines (30 loc) · 1.97 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
const { contextBridge, ipcRenderer } = require('electron');
contextBridge.exposeInMainWorld('electron', {
downloadJcef: () => ipcRenderer.invoke('download-jcef'),
downloadMicrobotLauncher: () => ipcRenderer.invoke('download-microbot-launcher'),
downloadClient: (version) => ipcRenderer.invoke('download-client', version),
downloadLauncherHtml: () => ipcRenderer.invoke('download-client'),
readProperties: () => ipcRenderer.invoke('read-properties'),
writeProperties: (data) => ipcRenderer.invoke('write-properties', data),
fetchLauncherVersion: () => ipcRenderer.invoke('fetch-launcher-version'), //jagex launcher
fetchClientVersion: () => ipcRenderer.invoke('fetch-client-version'),
fetchLauncherHtmlVersion: () => ipcRenderer.invoke('fetch-launcher-html-version'),
openLauncher: () => ipcRenderer.invoke('open-launcher'),
openClient: (version, proxy) => ipcRenderer.invoke('open-client', version, proxy),
readAccounts: () => ipcRenderer.invoke('read-accounts'),
removeAccounts: () => ipcRenderer.invoke('remove-accounts'),
jcefExists: () => ipcRenderer.invoke('jcef-exists'),
clientExists: (version) => ipcRenderer.invoke('client-exists', version),
launcherExists: () => ipcRenderer.invoke('launcher-exists'),
overwriteCredentialProperties: (character) => ipcRenderer.invoke('overwrite-credential-properties', character),
checkFileChange: () => ipcRenderer.invoke('check-file-change'),
playNoJagexAccount:(version, proxy) => ipcRenderer.invoke('play-no-jagex-account', version, proxy),
listJars:() => ipcRenderer.invoke('list-jars'),
launcherVersion:() => ipcRenderer.invoke('launcher-version'),
logError:(message) => ipcRenderer.invoke('log-error', message),
ipcRenderer: {
send: (channel, data) => ipcRenderer.send(channel, data),
receive: (channel, func) => ipcRenderer.on(channel, (event, ...args) => func(event, ...args)),
invoke: (channel, data) => ipcRenderer.invoke(channel, data),
}
});