Is it possible to share a node-context between multiple windows or at least between a window and its iframes? This would make sharing data a lot easier.
node-webkit does this by default, unless you use the new-instance
parameter on window.open().
Is something similar possible here? Does that require having the windows/iframes in the same process?
Thanks a lot!
There is no shared context in atom-shell, if you want to share an object between windows you can store the object in browser process and use
remote
module to access it in renderer:You can also use
localStorage
to store shared data.Happened upon this page and it seems the API suggested above has changed. It’s now:
require('electron').remote.getGlobal('sharedObject').someProperty = 'new value'
It’s worth noting, that while this works for simple objects, it’s useless for things like MediaStreams. I have a case where I need to display media streams originating in another window in child windows. For this reason alone, I’ve been forced to use NW.js
@NickClark How did you manage to achieve it with MediaStreams?