I have two windows: window A and window B.
- window A and window B have same domain
- window A and window B doesn't have any parent window.
- Is it possible for window A to get a reference of window B?
- what is the most elegant way to make window A notify something to window B?
(including new HTML5 specs)
Two ways i am aware of doing this:
- messaging by server: where window B regulary asks the server if window A has notified something
- messaging by local data (HTML5): when window A wants to notify something it changes the local data, window B regulary checks the local data for any changes.
But the two ways are not so elegant.
For example it would be nice to get a reference of window B and use window.postMessage() (HTML5)
Ultimate goal is to make something like facebook where if you open 4 facebook tabs and chat in one tab, the chat is up to date in every facebook tab, which is neat!