I am making an Office add-in which has two ribbon buttons. Each button is linked to a different TaskpaneId, and clicking on each button opens a different taskpane:
<bt:Urls>
<bt:Url id="Contoso.Taskpane1.Url" DefaultValue="https://localhost:3000/addin/page1" />
<bt:Url id="Contoso.Taskpane2.Url" DefaultValue="https://localhost:3000/addin/page2" />
</bt:Urls>
Now, I want to realise some communication between these two pages. For example, after some manipulations on page1
, I want page2
to be automatically refreshed (to reload data from server or localStorage
). As a result, when we click on page2
, it is already up-to-date. At the moment, it is not systematically updated, and to refresh page2
, we have to click on its ribbon button.
https://localhost:3000/
is built with mean-stack, so the pages use angularjs
and have a server behind. One way of communication of two pages is to via server: page1
sends a message by socket.io
to the server, and then the server emits a message by socket.io
to page2
. It is a little bit tedious.
Does anyone know if JavaScript API for Office has already any easy (and cross-platform) way to permit of such a communication between 2 taskpanes?
PS: using StorageEvent
of localStorage
is not a good idea, because it does not seem to work in Excel for Mac or for Windows.