-
-
Save VasylBakalets/9f719f849140254b856e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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