Home > Uncategorized > Internet Explorer only takes string in HTML5 postMessage

Internet Explorer only takes string in HTML5 postMessage

September 11th, 2012

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 caniuse.com 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.


Uncategorized , , ,

  1. Thiago Humberto
    September 12th, 2012 at 13:58 | #1

    IE sucks… sometimes we need to do magic =(

  2. jiro
    September 28th, 2012 at 06:07 | #2

    why dont serialize your objects to strings like base64

  3. December 15th, 2012 at 11:06 | #3

    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
    January 18th, 2013 at 03:36 | #4

    Thank you for confirming what I just discovered… :-(

  5. Niklas B
    August 20th, 2013 at 14:04 | #5

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

  6. September 10th, 2015 at 17:19 | #6

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

  1. No trackbacks yet.