title: Iframe contentWindow on different domain
body: <p>I'm working on custom scrolling for a page that will be hosted on domain B and opened in an iframe from a site hosted on domain A. I need to get frame's height and width like this:</p>
  
  <pre><code>clientHeight = parent.document.getElementById("mainForm").contentWindow.innerHeight || parent.document.getElementById("mainForm").offsetHeight;
  </code></pre>
  
  <p>This works when both pages are on the same domain but doesn't work when they're on different domains. I know I can use <code>postMessage</code> to request and get this information, I'm just not sure how to access frame size from the hosting page on domain A either. Things like <code>window.frames['abc'].contentWindow</code> are also blocked. Any ideas?</p>
  
  <p>P.S.: I did search this topic and found many similar topics, none of them answers this specific questions.</p>