title: Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://outlook.office.com') does not match the recipient window's origin
body: <p>The following is the start of a file form a working MS Outlook web add-in.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;meta charset="UTF-8" /&gt;
    &lt;meta http-equiv="X-UA-Compatible" content="IE=Edge" /&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js" type="text/javascript"&gt;&lt;/script&gt;
  
    &lt;script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js" type="text/javascript"&gt;&lt;/script&gt;
  
    &lt;link rel="stylesheet" href="https://appsforoffice.microsoft.com/fabric/1.0/fabric.min.css" /&gt;
    &lt;link rel="stylesheet" href="https://appsforoffice.microsoft.com/fabric/1.0/fabric.components.min.css" /&gt;
  
    &lt;script src="../../Assets/Scripts/jquery.fabric.js" type="text/javascript"&gt;&lt;/script&gt;
  
    &lt;link href="../../App.css" rel="stylesheet" type="text/css" /&gt;
    &lt;script src="../../App.js" type="text/javascript"&gt;&lt;/script&gt;
  
    &lt;script src="Demo.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;/head&gt; 
  </code></pre>
  
  <p>However, the demo is using JQuery, and I want to replace it with an existing AngularJs, modified to be a web add-in.</p>
  
  <p>My file starts</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;meta charset="UTF-8" /&gt;  
      &lt;script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js" type="text/javascript"&gt;&lt;/script&gt; 
      &lt;script src="MyDialogView.js" type="text/javascript"&gt;&lt;/script&gt; 
    &lt;title&gt;MyApp&lt;/title&gt;
  &lt;/head&gt;
  </code></pre>
  
  <p>and gives the following consiole error:</p>
  
  <blockquote>
    <p>Failed to execute 'postMessage' on 'DOMWindow': 
    The target origin provided ('<a href="https://outlook.office.com" rel="nofollow noreferrer">https://outlook.office.com</a>') does not match the recipient window's origin ('<a href="https://localhost" rel="nofollow noreferrer">https://localhost</a>').</p>
  </blockquote>
  
  <p>Which looks like a CORS problem. But why did I not get it from the file above, which is in the same directory on localhost?</p>
  
  <p>I can't post the entire app, but I am hoping that this strikes a chord in someone's memory ... What am I doing wrongly?</p>
  
  <hr>
  
  <p>[Update] unlike some similar questions, there are no iframes involved. Also, adding <code>&lt;AppDomain&gt;https://outlook.office.com&lt;/AppDomain&gt;</code> did not help (but why should it, when the page I copied from had no problems?)</p>