Electron: Renderer Access To Main Process?
The main process opens a connection to a service, to which a renderer requires access. Is this possible? I've tried declaring global.thing and exports.thing, and having the render
Solution 1:
You can do it in more ways:
1) Communicate between process with ipc and ask data with ipcRenderer.sendSync function, that asks to main process and wait for a return value. https://github.com/electron/electron/blob/master/docs/api/ipc-renderer.md
2) use exports in the right way, so:
in the main process:
exports.functionName = functionName;
in the renderer:
var functionName = remote.require('./main').functionName;
Post a Comment for "Electron: Renderer Access To Main Process?"