Shared state with child windows


#1

Is it possible to share state (references to javascript object) between a parent and child window?

I am aware of this approach: https://github.com/atom/atom-shell/issues/403#issuecomment-46278996 using remote to get a reference to a global object in the browser process…

But this does not truly allow sharing a true reference to an object… I cannot add functions to the shared object for example, or add new attributes.

If it was possible to open new windows a child windows, in the same render process as the parent, I would think this would be possible … but its not clear that there is any way to do that.


#2

I take it postMessage and localStorage are both out of the question right?

Chrome (browser) extensions give access to chrome.storage which is really powerful and can be synched in cloud too. It stores plain old objects, let’s you return a subset of keys, and can fire off events when updated etc. It’s also async. It’s pretty powerful. Maybe we should get something very similar in Atom? Can they “borrow” that code from Chrome?