<p>I am working on an iGoogle-like application. Content from other applications (on other domains) is shown using iframes. </p>

<p>How do I resize the iframes to fit the height of the iframes' content?</p>

<p>I've tried to decipher the javascript Google uses but it's obfuscated, and searching the web has been fruitless so far.</p>

<p><strong>Update:</strong> Please note that content is loaded from other domains, so the <a href="https://en.wikipedia.org/wiki/Same-origin_policy" rel="noreferrer">same-origin policy</a> applies.</p>

This is slightly tricky as you have to know when the iframe page has loaded, which is difficuly when you're not in control of its content. Its possible to add an onload handler to the iframe, but I've tried this in the past and it has vastly different behaviour across browsers (not guess who's the most annoying...). You'd probably have to add a function to the iframe page that performs the resize and inject some script into the content that either listens to load events or resize events, which then calls the previous function. I'm thinking add a function to the page since you want to make sure its secure, but I have no idea how easy it will be to do.