-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathpreload.js
More file actions
91 lines (90 loc) · 3.96 KB
/
preload.js
File metadata and controls
91 lines (90 loc) · 3.96 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
const { contextBridge, ipcRenderer } = require('electron');
contextBridge.exposeInMainWorld('electron', {
closeLauncher: () => ipcRenderer.invoke('close-launcher'),
minimizeWindow: () => ipcRenderer.invoke('minimize-window'),
maximizeWindow: () => ipcRenderer.invoke('maximize-window'),
startAuthFlow: () => ipcRenderer.invoke('start-auth-flow'),
downloadAndExtractBrowser: () =>
ipcRenderer.invoke('download-and-extract-browser'),
isBrowserDownloaded: () => ipcRenderer.invoke('is-browser-downloaded'),
downloadMicrobotLauncher: () =>
ipcRenderer.invoke('download-microbot-launcher'),
downloadClient: (version) => ipcRenderer.invoke('download-client', version),
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'),
openLauncher: () => ipcRenderer.invoke('open-launcher'),
openClient: (version, proxy, account, ramPreference) =>
ipcRenderer.invoke(
'open-client',
version,
proxy,
account,
ramPreference
),
readAccounts: () => ipcRenderer.invoke('read-accounts'),
deleteAccount: (accountId) =>
ipcRenderer.invoke('delete-account', accountId),
removeAccounts: () => ipcRenderer.invoke('remove-accounts'),
setProfileJagexAccount: (account, profile) =>
ipcRenderer.invoke('set-profile-jagex', account, profile),
setProfileNoJagexAccount: (profile) =>
ipcRenderer.invoke('set-profile-no-jagex', profile),
readNonJagexProfile: () => ipcRenderer.invoke('read-non-jagex-profile'),
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, ramPreference) =>
ipcRenderer.invoke(
'play-no-jagex-account',
version,
proxy,
ramPreference
),
listJars: () => ipcRenderer.invoke('list-jars'),
listProfiles: () => ipcRenderer.invoke('list-profiles'),
launcherVersion: () => ipcRenderer.invoke('launcher-version'),
logError: (message) => ipcRenderer.invoke('log-error', message),
errorAlert: (options) => ipcRenderer.invoke('error-alert', options),
showConfirmationDialog: (
message,
detail,
title,
yesButton,
noButton,
options
) =>
ipcRenderer.invoke(
'show-confirmation-dialog',
message,
detail,
title,
yesButton,
noButton,
options
),
openLocation: (locationKey) =>
ipcRenderer.invoke('open-location', locationKey),
cleanUnusedClients: (latestVersion) =>
ipcRenderer.invoke('cleanup-unused-clients-jar', latestVersion),
updateClientJarTTL: (version) =>
ipcRenderer.invoke('update-client-jar-ttl', version),
refreshAccounts: () => ipcRenderer.invoke('refresh-accounts'),
auth: {
signup: (credentials) => ipcRenderer.invoke('auth:signup', credentials),
signin: (credentials) => ipcRenderer.invoke('auth:signin', credentials),
signout: () => ipcRenderer.invoke('auth:signout'),
changePassword: (payload) =>
ipcRenderer.invoke('auth:changepw', payload),
status: () => ipcRenderer.invoke('auth:status')
},
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)
}
});