title: window.postMessage from iframe to callee, both iframe and callee are in same domain
body: <p>Having problems in using window.postMessage from iframe to the callee.
  Both the iframe and callee are in same domain.</p>
  
  <p>callee --  1st registered  listener, which listens to the message.
  Using Marionette.js at calle, below is the code at callee </p>
  
  <pre><code>return Marionette.ItemView.extend({
          initialize: function(opts){
              window.addEventListener('message', this.listenToMessage);
          },
  // 'listenToMessage' never gets called
  listenToMessage: function(message){
              console.log('message received from iframe');
          }
  
      });
  });
  </code></pre>
  
  <p>The code which is posting the message from iframe. Made sure window.postMessage is successful because its not going to window.onerror, but the message is not going to receiver, below is the code in iframe onload</p>
  
  <pre><code> &lt;script&gt;
          window.onload = function() {
              var origin = document.location.origin; //--&gt;https://dev03.com
              console.log('About to post message ---&gt; ' origin: '+origin);
              window.postMessage('Hi this message is from iFrame', origin);
  
          };
  
          window.onerror = function(message, source, lineno, colno) {
              console.log('message --&gt; '+message);
              console.log('source --&gt; '+source);
              console.log('lineno --&gt; '+lineno);
              console.log('colno --&gt; '+colno);
          }
      &lt;/script&gt;
  </code></pre>