PostMessage Popups and IE

If you have not used postMessage (or Cross Document Messaging to use it’s proper title) it’s a way of securely sending messages between frames even when the documents passing messages are on different domains. To learn more about it you can read this introduction that we wrote during the IE8 launch.

It works in IE8, IE9 and IE9 for WP7… however in IE it only works for embedded frames. This can cause issues for some users that maybe using it to pass messages back from pop-up windows or other tabs as they receive the error message “No Such Interface supported”.

An example of the issue can be seen on the following  test page. Click the Create Popup button and then in the new window click the Call postMessage directly button.  In IE, this demo will fail and the script will display the exception “No Such Interface supported”. The issue also exists if you want to use post Message across tabs as demonstrated in the following test.

There are some instances where you can workaround this problem. If the popup window instead calls a script function in its window.opener page (click the Call opener's proxy function button), the script function can call postMessage to send a message to the child frame. However the workaround isn’t useful in cases where you are working cross domain, because same-origin-policy dictates that the popup window and the window.opener page must be from the same origin in order to call each other's script functions.

Comments (5)

  1. dave says:

    safari mmeaans journey so maybe it signfys the juyrney through knowledge that is the internet

  2. Andreas says:

    Thanks for this, it helped me resolve a problem when using a jquery postmessage plugin.

  3. Sam says:

    Are there no updates to the IE8 to work with the postmessage??

    There are always javascript problems with IE8..

  4. EricLaw [ex-MSFT] says:

    I wrote about this and other HTML5 implementation issues here:

    @Sam: No, as a rule, the IE team doesn't make functional updates of this nature in servicing (patches); only security fixes, crashes, and the like are fixed for legacy browsers.

  5. Eric Wang says:

    That's so sad, it's really make the life become much more harder.

Skip to main content