Fix Firefox DOM clone not being ready

This commit is contained in:
Niklas von Hertzen 2014-03-05 22:24:53 +02:00
parent 85b77ca49f
commit 3101f2007a
3 changed files with 20 additions and 4 deletions

View File

@ -113,7 +113,15 @@ function createWindowClone(ownerDocument, width, height, options) {
if (options.type === "view") {
container.contentWindow.scrollTo(window.pageXOffset, window.pageYOffset);
}
resolve(container);
var timeout = setTimeout(function() {
resolve(container);
}, 100);
container.contentWindow.onload = function() {
clearTimeout(timeout);
resolve(container);
};
});
}

File diff suppressed because one or more lines are too long

View File

@ -104,7 +104,15 @@ function createWindowClone(ownerDocument, width, height, options) {
if (options.type === "view") {
container.contentWindow.scrollTo(window.pageXOffset, window.pageYOffset);
}
resolve(container);
var timeout = setTimeout(function() {
resolve(container);
}, 100);
container.contentWindow.onload = function() {
clearTimeout(timeout);
resolve(container);
};
});
}