I need to access a nested iframe at an arbitrary number of levels deep from a Firefox extension’s overlay (an iframe within an iframe within an iframe within…). The overlay receives the event from the iframe, but the DOM accessor method returns nil.
function resizeIframe(evt){
var iframeHeight = evt.target.getAttribute("height");
var frame_id = evt.target.getAttribute("frame_id");
var ifr = content.document.getElementById('ifrm'+frame_id);//returns nil
ifr.style.height = iframeHeight+'px';
}
I’m looking for a robust way to do this, but I would be happy with anything that works at this point. Thanks!
Use
window.frameElementproperty: