'use strict'; // Minimal, validated bridge. The renderer gets NO Node.js access (contextIsolation + sandbox + nodeIntegration off). const { contextBridge, ipcRenderer } = require('electron'); contextBridge.exposeInMainWorld('fptDesktop', { version: '1.0.0', notify: (title, body) => ipcRenderer.send('fpt:notify', { title: String(title), body: String(body) }), openSettings: () => ipcRenderer.send('fpt:open-settings'), // Only honoured by the main process for the local settings page: getConfig: () => ipcRenderer.invoke('fpt:get-config'), saveConfig: (cfg) => ipcRenderer.invoke('fpt:save-config', cfg), });