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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

7 lines
271 B
JavaScript
Raw Normal View History

const { contextBridge, ipcRenderer } = require('electron/renderer')
contextBridge.exposeInMainWorld('electronAPI', {
createDemoWindow: () => ipcRenderer.send('create-demo-window'),
onBoundsChanged: (callback) => ipcRenderer.on('bounds-changed', () => callback())
})