Cross window communication


#1

I need the ability to communicate across windows between instances of my plugin. Currently, I call

`atom.open({pathsToOpen: [path], newWindow: true})

It would be really nice to be able to tell the plugin in the new window to go do something. For that matter, it would be nice to know if or when the window is opened.

Intellij provides an abstraction to plugin authors for this sort of behavior by allowing plugins to hook either projects or the application itself. Application level plugins are essentially public singletons.


#2

I second that request. Working on atom-diary, I am adding a function to open the whole diary structure in a new window. I would like to be able to do some stuff in the window like:

  • get active editor in diary window
  • pop up diary window whenever a diary file is opened which part of the diary project

Any ideas how to do this?


#3

@sluedecke

For Floobits, we used the config API to hack in cross window communication - see https://atom.io/docs/api/v1.1.0/Config#instance-observe


#4

Thanks for the hint, that indeed is a workable solution :slight_smile:


#5

Has anyone found a better solution than using the config API yet? If not, how to hide a certain config prop from the user (since I want to use it only internally)?