How to send messages to open tabs of an app on Chrome

Asked

Viewed 157 times

3

I’m fixing the sync part between the open tabs of my app and remembered that Google Chrome has an API that if I’m not mistaken does exactly what I need, send messages internally in an app.

I took a look at Google and Chrome Developers and got all confused, so I thought it would be better to ask who already understands the subject.

I need a code that sent messages to the open tabs of an app (as already said) and also how it would be to receive this message.

  • 1

    I don’t know about the Chrome API, but maybe window.postMessage resolve (you need a reference to each window).

1 answer

1

In a recent project it was necessary to do something similar. It consisted of an accounting system. When the user selected another company, all tabs should be notified and updated.

The system in question was implemented in JSF 2 with Primefaces, so I used the Push component, which, underneath the screens, uses the framework Atmosphere.

This link contains a tutorial on the framework.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.