I have a packaged chrome app having multiple windows. For example if I click a button in first window then a second window opened. Now how to send messages or commands to each other. I have read a lot about it but did not figure out as i am very much new to this. Any sample code will be very helpful.
There is a existing question How to communicate between multiple windows of the same chrome app?, but did not understand how to do it.
Thanks in advance!!!
You can use the postmessage method of a window, in order to send information to another window. By following this approach, you can execute a method from a window (A) on a different window (B). You'll need to create an event on window B that will inform A that the method ran correctly.
The code would be something like:
Sender:
Destination:
You can also find an in-dept explanation here: http://davidwalsh.name/window-postmessage