diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2019-05-11 20:51:05 -0400 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2019-05-11 20:51:05 -0400 |
commit | 2fcb5c7c5c1fe3e722aa02737143c2cac570cc5e (patch) | |
tree | 8096c493aaa094196d4861faec062e202f81bcae /base | |
parent | 3f256fab9a5482938f8834256cfdab0162bf466a (diff) | |
download | iceweasel-uxp-2fcb5c7c5c1fe3e722aa02737143c2cac570cc5e.tar.gz |
backport UXP - Update surrounding code for new Readerable module. Tag #361
Diffstat (limited to 'base')
-rw-r--r-- | base/content/tab-content.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/base/content/tab-content.js b/base/content/tab-content.js index 35ef8ce..fec13eb 100644 --- a/base/content/tab-content.js +++ b/base/content/tab-content.js @@ -20,6 +20,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "AboutReader", "resource://gre/modules/AboutReader.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode", "resource://gre/modules/ReaderMode.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Readerable", + "resource://gre/modules/Readerable.jsm"); XPCOMUtils.defineLazyGetter(this, "SimpleServiceDiscovery", function() { let ssdp = Cu.import("resource://gre/modules/SimpleServiceDiscovery.jsm", {}).SimpleServiceDiscovery; // Register targets @@ -336,7 +338,7 @@ var AboutReaderListener = { * painted is not going to work. */ updateReaderButton: function(forceNonArticle) { - if (!ReaderMode.isEnabledForParseOnLoad || this.isAboutReader || + if (!Readerable.isEnabledForParseOnLoad || this.isAboutReader || !content || !(content.document instanceof content.HTMLDocument) || content.document.mozSyntheticDocument) { return; @@ -375,7 +377,7 @@ var AboutReaderListener = { this.cancelPotentialPendingReadabilityCheck(); // Only send updates when there are articles; there's no point updating with // |false| all the time. - if (ReaderMode.isProbablyReaderable(content.document)) { + if (Readerable.isProbablyReaderable(content.document)) { sendAsyncMessage("Reader:UpdateReaderButton", { isArticle: true }); } else if (forceNonArticle) { sendAsyncMessage("Reader:UpdateReaderButton", { isArticle: false }); |