Commit 44395004 authored by Juan Corona's avatar Juan Corona

Rename FrameUtil.isReady to .isDocumentReady

Better differentiation from .isLoaded
parent e7d6d83b
...@@ -38,7 +38,7 @@ class FrameObserver { ...@@ -38,7 +38,7 @@ class FrameObserver {
_addFrame (frame) { _addFrame (frame) {
if (FrameUtil.isAccessible(frame)) { if (FrameUtil.isAccessible(frame)) {
FrameUtil.isReady(frame, () => { FrameUtil.isDocumentReady(frame, () => {
frame.contentWindow.addEventListener('unload', () => { frame.contentWindow.addEventListener('unload', () => {
this._removeFrame(frame); this._removeFrame(frame);
}); });
......
...@@ -43,7 +43,7 @@ function isValid (iframe) { ...@@ -43,7 +43,7 @@ function isValid (iframe) {
return iframe.className !== 'h-sidebar-iframe'; return iframe.className !== 'h-sidebar-iframe';
} }
function isReady (iframe, callback) { function isDocumentReady (iframe, callback) {
if (iframe.contentDocument.readyState === 'loading') { if (iframe.contentDocument.readyState === 'loading') {
iframe.contentDocument.addEventListener('DOMContentLoaded', function () { iframe.contentDocument.addEventListener('DOMContentLoaded', function () {
callback(); callback();
...@@ -70,5 +70,5 @@ module.exports = { ...@@ -70,5 +70,5 @@ module.exports = {
isAccessible: isAccessible, isAccessible: isAccessible,
isValid: isValid, isValid: isValid,
isLoaded: isLoaded, isLoaded: isLoaded,
isReady: isReady, isDocumentReady: isDocumentReady,
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment