I've been trying to edit some pages as local htm files on my computer, but I've run into this problem where functions using the contentWindow property don't work when the parent page and the page within the iframe are local files. When all the pages are uploaded the exact same codes work fine, but not as local files. It's only in Chrome and Opera that I've had this problem. In Firefox and Safari and even Internet Explorer contentWindow works fine with local files.
This is very annoying because I've got a dynamic iframe resize in the page I'm working on and I don't want to have to reupload all the pages every time I want to test them in Chrome which is my main browser.
Is there some sort of security setting in Chrome (and Opera) that's causing this problem, and if so can it be disabled?
The code is just:
function resizeIframe(iframeName) {
document.getElementById(iframeName).style.height = '1000px';
newHeight = document.getElementById(iframeName).contentWindow.document.body.scrollHeight;
setTimeout(function () {
document.getElementById(iframeName).style.height = newHeight + 'px';
}, 10);
}