This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
const { contextBridge, ipcRenderer } = require('electron');
|
||||
|
||||
// Deliberately expose only fixed, argument-checked operations; no Node or IPC primitive is leaked.
|
||||
contextBridge.exposeInMainWorld('prospectDesktop', Object.freeze({
|
||||
getBackendUrl: () => ipcRenderer.invoke('backend:get'),
|
||||
setBackendUrl: (url) => ipcRenderer.invoke('backend:set', String(url ?? '')),
|
||||
reload: () => ipcRenderer.invoke('window:reload'),
|
||||
reconnect: () => ipcRenderer.invoke('window:reconnect'),
|
||||
clearSession: () => ipcRenderer.invoke('session:clear'),
|
||||
openSettings: () => ipcRenderer.invoke('settings:open')
|
||||
}));
|
||||
Reference in New Issue
Block a user