PostMessage add-on

Howdy.

I released an add-on for using html5’s window.postMessage with Vaadin 7. The very imaginative name of the add-on is
PostMessageAddon
(Apache License 2.0).


window.postMessage
is a secure way to enable two documents from different origins to communicate with each other. The basics of the standard are a must read before using this add-on.

The add-on currently only supports posting&receiving String messages, but I’ll add support for
other types
soonish.

The add-on is by not nearly as good as it could be, so all feedback, further development ideas, help and bug reports are most welcome here on this thread. The source code is available on
github
and
here
is a demo application that just demonstrates the components without actually showing any real life use case for post messaging.

Hi, I’m just evaluating Vaadin (it’s seems great!) for our purposes and I’m also testing your addon.

I’m having some problems with a simple PostMessage test:

  • Two Vaadin applications (Parent and Child).
  • Parent App holds an PostMessageIframe that points to Child App.
  • Child App have a PostMessageReceiver to receive message and answer to his parent.
  • Same Tomcat 8.0 Server for both applications.


That’s it! But it’s not working. I think that something is happening with message origins but I’m not sure.

Any clue?

Thanks a lot!

Hi again!
I’ve made some advances but still no full success. I have replaced your parent code in
PostmessageDemoUI.java
with my own implementation. The iframe url is the one on your example (http://pekka.virtuallypreinstalled.com). And it works!

Now I’m stuck with my own implementation for the iframe applicacion.

Any little help? Can you post your iframe implementation?

Thanks in advance.