зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1147487 - don't bother sending reader mode updates when isArticle is false, r=margaret
--HG-- extra : rebase_source : ccc17edf45f1cc70d9582ecd1a30db737deb3c14
This commit is contained in:
Родитель
a3918649d6
Коммит
b3d2ee3aa4
|
@ -568,11 +568,16 @@ let AboutReaderListener = {
|
|||
}
|
||||
},
|
||||
updateReaderButton: function() {
|
||||
if (!ReaderMode.isEnabledForParseOnLoad || this.isAboutReader) {
|
||||
if (!ReaderMode.isEnabledForParseOnLoad || this.isAboutReader ||
|
||||
!(content.document instanceof content.HTMLDocument) ||
|
||||
content.document.mozSyntheticDocument) {
|
||||
return;
|
||||
}
|
||||
let isArticle = ReaderMode.isProbablyReaderable(content.document);
|
||||
sendAsyncMessage("Reader:UpdateReaderButton", { isArticle: isArticle });
|
||||
// Only send updates when there are articles; there's no point updating with
|
||||
// |false| all the time.
|
||||
if (ReaderMode.isProbablyReaderable(content.document)) {
|
||||
sendAsyncMessage("Reader:UpdateReaderButton", { isArticle: true });
|
||||
}
|
||||
},
|
||||
};
|
||||
AboutReaderListener.init();
|
||||
|
|
Загрузка…
Ссылка в новой задаче