electron/docs/fiddles/windows/manage-windows/new-window/preload.js

5 lines
181 B
JavaScript

const { contextBridge, ipcRenderer } = require('electron/renderer')
contextBridge.exposeInMainWorld('electronAPI', {
newWindow: (args) => ipcRenderer.send('new-window', args)
})