Files
echoes-of-the-ash/pwa/electron/preload.cjs

18 lines
591 B
JavaScript

const { contextBridge, ipcRenderer } = require('electron')
// Expose protected methods that allow the renderer process to use
// ipcRenderer without exposing the entire object
contextBridge.exposeInMainWorld('electronAPI', {
// Get Steam authentication data
getSteamAuth: () => ipcRenderer.invoke('get-steam-auth'),
// Check if Steam is available
isSteamAvailable: () => ipcRenderer.invoke('is-steam-available'),
// Get platform info
getPlatform: () => ipcRenderer.invoke('get-platform'),
// Flag to indicate we're running in Electron
isElectron: true
})