On the atom-shell branch in Atom I'm trying to recreate the functionality of atom.getWindowState using ipc, but it is not working.
On the renderer side I use this code to retrieve data from the browser process:
dataFromBrowser = ipc.sendChannelSync('browser-data-request', 'THIS IS FROM THE RENDERER')
console.log 'got this data from the browser', dataFromBrowser
Here is the code to listen for that event on the browser process (in main.coffee):
ipc.on 'browser-data-request', (processId, messageId, message) ->
console.log 'browser got request', processId, messageId, message
ipc.sendChannel('window-state', processId, messageId, "THIS SOME DATA FROM THE BROWSER")
The browser ipc callback gets some strange params though, it gets:
{} 2 1 THIS IS FROM THE RENDERER []
Also, the call to sendChannelSync doesn't return THIS IS SOME DATA FROM THE BROWSER it returns undefined.
Am I using this wrong?
Is there a better way to do this?
On the
atom-shellbranch in Atom I'm trying to recreate the functionality ofatom.getWindowStateusing ipc, but it is not working.On the renderer side I use this code to retrieve data from the browser process:
Here is the code to listen for that event on the browser process (in main.coffee):
The browser ipc callback gets some strange params though, it gets:
{}21THIS IS FROM THE RENDERER[]Also, the call to sendChannelSync doesn't return
THIS IS SOME DATA FROM THE BROWSERit returnsundefined.Am I using this wrong?
Is there a better way to do this?