electron/spec/fixtures/preload-expose-ipc.js

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

15 lines
359 B
JavaScript
Raw Normal View History

2022-08-03 23:55:12 +00:00
const { contextBridge, ipcRenderer } = require('electron');
// NOTE: Never do this in an actual app! Very insecure!
contextBridge.exposeInMainWorld('ipc', {
send (...args) {
return ipcRenderer.send(...args);
},
sendSync (...args) {
return ipcRenderer.sendSync(...args);
},
invoke (...args) {
return ipcRenderer.invoke(...args);
}
});