Bug 925983 - Misc javascript error in aboutReader on restart with multiple tabs in readermode, r=lucasr

This commit is contained in:
Mark Capella 2013-10-18 01:28:17 -04:00
Родитель 7c74c4095d
Коммит 9deb76cc82
1 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -3390,8 +3390,16 @@ Tab.prototype = {
this.browser.addEventListener("pagehide", listener, true);
}
if (docURI.startsWith("about:reader"))
new AboutReader(this.browser.contentDocument, this.browser.contentWindow);
if (docURI.startsWith("about:reader")) {
// During browser restart / recovery, duplicate "DOMContentLoaded" messages are received here
// For the visible tab ... where more than one tab is being reloaded, the inital "DOMContentLoaded"
// Message can be received before the document body is available ... so we avoid instantiating an
// AboutReader object, expecting that an eventual valid message will follow.
let contentDocument = this.browser.contentDocument;
if (contentDocument.body) {
new AboutReader(contentDocument, this.browser.contentWindow);
}
}
break;
}