Running a new component in a new window

Hi,

in JS (and in appropriate PS library too), we can open new windows/tabs via window.open function. I was curious, is it possible to run Halogen component in such a window? My use case is to open a new window and run a component that listens to a websocket there (reading logs of the action triggered in the first window) while still be able to browse the first window (and open new windows with other logs, possibly).

Should it be possible to fork runUI on the new window, is it going to work with no caveats?

I think it should be workable, but the cross-window communication is what will need figuring out moreso than anything Halogen specific.

If I remember right communication is done through postMessage on the opened Window object / window.parent to send, and message event listeners on the window objects to receive. So as long as you do some plumbing between the message event and the HalogenIO (or just listen directly in the root components) it should be possible to have the components talk to each other.

1 Like