electron/docs/fiddles/menus/customize-menus/preload.js

6 lines
184 B
JavaScript

const { contextBridge, ipcRenderer } = require('electron/renderer')
contextBridge.exposeInMainWorld('electronAPI', {
showContextMenu: () => ipcRenderer.send('show-context-menu')
})