title: How to add a css file to an open window
body: <p>I am trying to open a new html window and link it to an external css file.. </p>
  
  <pre><code>var myWindow = window.open("", "MsgWindow");
  
  var fileref=document.createElement("link");
  fileref.setAttribute("rel", "stylesheet");
  fileref.setAttribute("type", "text/css");
  fileref.setAttribute("href", 'kamusi_ext-v1.css');
  
  myWindow.document.head.appendChild(fileref);
  </code></pre>
  
  <p>However I am getting this error: </p>
  
  <blockquote>
    <p>script.js:70 Uncaught SecurityError: Blocked a frame with origin "null" from accessing a frame with origin "null". Protocols, domains, and ports must match.</p>
  </blockquote>
  
  <p>When running the same script on Firefox, I am not getting this error but the css is not being applied!</p>