Reputation: 76
I plan to write my Electron app, but I still don't have any ideas how to implement such use case - How to call some logic in Electron application from outside?
For example, there is a real application MavensMate. I can run it and leave in tray, and next from Sublime text menu I can run different logic inside MavensMate.
Upvotes: 1
Views: 256
Reputation: 76
I found solution:
In Electron app start ExpressJS server (from mainProcess)
In ExpressJS request handler add
win.webContents.send('superEvent', 'ping');
In rendererProcess add
ipcRenderer.on('superEvent', (event, arg) => {alert('pong')});
Start Electon app, open ExpressJS page in Browser and you will see alert in Electron window. Profit! :)
Upvotes: 1