electron/docs/fiddles/native-ui/external-links-file-manager/preload.js

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

7 lines
241 B
JavaScript
Raw Normal View History

const { contextBridge, ipcRenderer } = require('electron/renderer')
contextBridge.exposeInMainWorld('electronAPI', {
openHomeDir: () => ipcRenderer.send('open-home-dir'),
openExternal: (url) => ipcRenderer.send('open-external', url)
})