Test-fix for #1149

This commit is contained in:
AlexVallat 2015-04-05 17:52:23 +01:00
parent 8ea7dc54a7
commit e762a29d30
1 changed files with 13 additions and 2 deletions

View File

@ -55,11 +55,22 @@ function startup(data, reason) {
.getService(Components.interfaces.nsIAppShellService);
let onReady = function (e) {
console.log("uBlock> onReady");
if (e) {
console.log("uBlock> removing event listener " + e.type + " from " + this);
this.removeEventListener(e.type, onReady);
}
let hiddenDoc = appShell.hiddenDOMWindow.document;
if (hiddenDoc.readyState === 'loading') {
console.log("uBlock> hiddenDOMWindow not ready, waiting");
hiddenDoc.addEventListener('DOMContentLoaded', onReady);
return;
}
bgProcess = hiddenDoc.documentElement.appendChild(
hiddenDoc.createElementNS('http://www.w3.org/1999/xhtml', 'iframe')
);