Is there any way to listen for changes in the main window state from some other window?

Hi,
I am storing the global state for my app in the main overwolf window. Is there any way to listen for changes in that state from some other window?

Can I, for example, run a function when the state in the main window changes?
For example by passing a callback function into the main window.

Your other windows can directly access the DOM/Window and JS elements of the main window: overwolf.windows.getMainWindow().

And yes, you can pass a callback from the second window to the main window.

Each of your windows can register to listen to events on the main window, maintaining a list of all listeners. When the state changes, it notifies all the listeners that the state has changed.