Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var isFrameLoadedRecursive = function(aParent) {
if(typeof aParent === 'undefined' || typeof aParent.document === 'undefined' || typeof aParent.document === 'unknown') {
return true;
}
var result = aParent.document.readyState == 'complete' || aParent.document.readyState == 'interactive';
if(result && typeof aParent.statusbarMap != 'undefined') {
for(var s in aParent.statusbarMap) {
result = aParent.statusbarMap[s].onComplete === null;
if(!result) {
break;
}
}
}
if(result && typeof aParent.frames != 'undefined' && aParent.frames.length > 0) {
for(var i = 0; i < aParent.frames.length; i++) {
result = isFrameLoadedRecursive(aParent.frames[i]);
if(!result) {
break;
}
}
}
return result;
}
return isFrameLoadedRecursive(top)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.