crosstalk/electron/preload.js
Macgyver Official 953ea693f4 Rename project to Crosstalk and update branding
Rename Reticulum MeshChat to Crosstalk across the codebase and packaging. Renamed meshchat.py to crosstalk.py and updated Dockerfile, docker-compose, GitHub Actions, README, docs and electron assets to use Crosstalk, new storage/reticulum config paths (~/.crosstalk/.reticulum), and GHCR tags/labels. Add logic to seed a default RMAP World TCP client interface and a config flag, shorten interface/transport responses to remove forced restart messages, and update database proxy comment. Electron: set app name, implement an internal prompt (replacing electron-prompt), expose restart-backend IPC, change backend executable naming/launching (startBackend/start/stop handling), and adjust portable storage behavior. Misc: remove donate.md, add example image and egg-info files, and apply multiple frontend/component and static asset updates to match rebrand and UX improvements.
2026-06-21 07:43:38 -04:00

43 lines
1.5 KiB
JavaScript

const { ipcRenderer, contextBridge } = require('electron');
// forward logs received from exe to web console
ipcRenderer.on('log', (event, message) => console.log(message));
contextBridge.exposeInMainWorld('electron', {
// allow fetching app version in electron browser window
appVersion: async function() {
return await ipcRenderer.invoke('app-version');
},
// show an alert dialog in electron browser window, this fixes a bug where alert breaks input fields on windows
alert: async function(message) {
return await ipcRenderer.invoke('alert', message);
},
// show a confirm dialog in electron browser window, this fixes a bug where confirm breaks input fields on windows
confirm: async function(message) {
return await ipcRenderer.invoke('confirm', message);
},
// add support for using "prompt" in electron browser window
prompt: async function(message) {
return await ipcRenderer.invoke('prompt', message);
},
// allow relaunching app in electron browser window
relaunch: async function() {
return await ipcRenderer.invoke('relaunch');
},
// allow restarting the python backend without closing the electron app
restartBackend: async function(returnRoute) {
return await ipcRenderer.invoke('restart-backend', returnRoute);
},
// allow showing a file path in os file manager
showPathInFolder: async function(path) {
return await ipcRenderer.invoke('showPathInFolder', path);
},
});