preload.js 458 B

12345678910111213
  1. /**
  2. * The preload script runs before. It has access to web APIs
  3. * as well as Electron's renderer process modules and some
  4. * polyfilled Node.js functions.
  5. *
  6. * https://www.electronjs.org/docs/latest/tutorial/sandbox
  7. */
  8. const { contextBridge, ipcRenderer } = require('electron');
  9. contextBridge.exposeInMainWorld('electronAPI', {
  10. startDesign: () => ipcRenderer.send('start-design', ""),
  11. startInvoke: () => ipcRenderer.send('start-invoke', ""),
  12. })