Passing json objects into ipcRenderer.send


#1

Any code example on how I can pass in a json object into send / recv function through electron ipc functions.


#2

There are examples in the documentation on how to send and receive messages in both directions:

http://electron.atom.io/docs/api/ipc-main/#sending-messages


#3

All examples i have come across seem to pass just one string as argument

Ex:

win.webContents.send(‘ping’, ‘whoooooooh!’)

Can I do something like

win.webContents.send(‘ping’, {keys:[‘name’:‘whoooooooh!’, ‘value’:‘woooww’]})


#4

Yes, you can.