Internet Explorer only takes string in HTML5 postMessage

Today I learned the hard way that our beloved Internet Explorer doesn’t handle HTML5 cross-domain messaging functionality (AKA postMessage) correctly.

I have done a reasonable amount of research before I invested a significant time into this, and so I knew it doesn’t postMessage across tabs and windows beforehand. This limitation was not a problem for me, because I was going to use this in IFRAME.

The problem that I discovered much too late is that IE only accepts a string as a message (see BSTR in a signature? That’s a Windows speak for passing UTF-16 strings.) This is despite the fact that the draft spec allowed any object and not just strings as early as Novemember 2010 .

And other sites like and various blog posts failed me too, as they failed to mention this limitation.

So I’m posting this here in the hope that this will prevent other people from wasting time.


6 Comments Add yours

  1. Thiago Humberto says:

    IE sucks… sometimes we need to do magic =(

  2. jiro says:

    why dont serialize your objects to strings like base64

  3. thank says:

    Howdy just wanted to give you a quick heads up. The text in your content seem to be running
    off the screen in Ie. I’m not sure if this is a format issue or something to do with internet browser compatibility but I figured I’d
    post to let you know. The layout look great though!
    Hope you get the problem fixed soon. Kudos

  4. Chris Haines says:

    Thank you for confirming what I just discovered… 🙁

  5. Niklas B says:

    Thank you for confirming this.. a google on “ie9 postmessage object” lead me to this post.

  6. Thank you for this!!! Luckily JSON.stringify comes to the rescue for basic objects in IE9

Leave a Reply

Your email address will not be published. Required fields are marked *