IE11 throw a DataCloneError when re-post a message received from another window even on the same domain

Confirmed Issue #3169349 • Assigned to Travis L.

Details

Created
Jun 11, 2015
Privacy
This issue is public.
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

URL:

Repro Steps:

  1. Create a web site in IIS

  2. Add index.html and app-report-error.js with following content

    // index.html
    <!DOCTYPE html>

    <html lang="en">
    <head>
    <meta charset="utf-8" />
    <title>TypeScript HTML App</title>
    <script src="app-report-error.js"></script>
    </head>
    <body>
    <button id="addNewWindow">New Window</button>
    <button id="send-to-master">Send to Master</button>
    </body>
    </html>

// app-report-error.js
window.onload = function () {
    var domain = 'http://localhost/';
    var url = domain + location.pathname;
    document.querySelector('#addNewWindow').addEventListener('click', function () {
        window.myPopup = window.open(url, '_blank');
        window.myPopup.addEventListener('message', function (event) {
            // re-post to current window with the same domain
            window.postMessage(event.data, domain);
        });
    });
    document.querySelector('#send-to-master').addEventListener('click', function () {
        var message = {
            channelKey: 'test',
            channelMode: 1,
            contextData: {
                data: {},
                header: {
                    currentTime: 'Master!  The time is: ' + (new Date().getTime()),
                    requestID: 'R_1234',
                    targetID: 'T_1233_ContextInfoService',
                }
            }
        };
        // post to the master window
        window.postMessage(message, domain);
    });
};
  1. Run the website in IE
  2. Click on “New Window” button, which will open the second window
  3. In the second window, click on “Send to Master” button
  4. The first window will throw DataCloneError

Expected Results:

I have test the same code with all other browsers (Chrome 40.0.2214.111 m, Firefox 28.0), they all allow message to be re-post without error.

Actual Results:

Dev Channel specific:

No

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Christian F.”

      Changed Assigned To to “Venkat K.”

      Changed Assigned To from “Venkat K.” to “Travis L.”

      Changed Status to “Confirmed”

    You need to sign in to your Microsoft account to add a comment.

    Sign in