Perform the "heavy lifting" or native API calls (e.g., using the dialog module to open files). Send results back to the renderer if necessary. 2. Securely Expose the Feature (Preload Script)
Listen for custom events using ipcMain.on or ipcMain.handle .
Call the exposed functions from your window object (e.g., window.myAPI.doSomething() ).
Perform the "heavy lifting" or native API calls (e.g., using the dialog module to open files). Send results back to the renderer if necessary. 2. Securely Expose the Feature (Preload Script)
Listen for custom events using ipcMain.on or ipcMain.handle .
Call the exposed functions from your window object (e.g., window.myAPI.doSomething() ).