16 lines
683 B
JavaScript
16 lines
683 B
JavaScript
// Preload (Isolated World)
|
|
const { contextBridge, ipcRenderer } = require('electron');
|
|
|
|
// We are not exposing anything to the renderer process for this simple app.
|
|
// If we needed to, it would look something like this:
|
|
/*
|
|
contextBridge.exposeInMainWorld('electronAPI', {
|
|
// Example: expose a function to send a message to the main process
|
|
// sendMessage: (message) => ipcRenderer.send('some-channel', message),
|
|
|
|
// Example: expose a function to receive messages from the main process
|
|
// onMessage: (callback) => ipcRenderer.on('other-channel', (_event, ...args) => callback(...args)),
|
|
});
|
|
*/
|
|
|
|
console.log('Preload script loaded. Context isolation is on.');
|