Bug 1132674 - Show reader toolbar button on DOMContentLoaded instead of pageshow. r=Gijs
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Wed, 18 Mar 2015 10:35:53 -0700
changeset 263257 5bdecf0d7d63629ec8a9ef5a99b0e11c7e03895b
parent 263256 1fd14a76c48397afc8fe9c8866f8fd7c48e5e5bb
child 263258 b467fad71782b4dad59ef6e98b20dfccb0c4f78d
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1132674
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1132674 - Show reader toolbar button on DOMContentLoaded instead of pageshow. r=Gijs
browser/base/content/content.js
--- a/browser/base/content/content.js
+++ b/browser/base/content/content.js
@@ -480,17 +480,17 @@ let AboutHomeListener = {
 AboutHomeListener.init(this);
 
 let AboutReaderListener = {
 
   _articlePromise: null,
 
   init: function() {
     addEventListener("AboutReaderContentLoaded", this, false, true);
-    addEventListener("pageshow", this, false);
+    addEventListener("DOMContentLoaded", this, false);
     addEventListener("pagehide", this, false);
     addMessageListener("Reader:ParseDocument", this);
   },
 
   receiveMessage: function(message) {
     switch (message.name) {
       case "Reader:ParseDocument":
         this._articlePromise = ReaderMode.parseDocument(content.document).catch(Cu.reportError);
@@ -520,17 +520,17 @@ let AboutReaderListener = {
           new AboutReader(global, content, this._articlePromise);
         }
         break;
 
       case "pagehide":
         sendAsyncMessage("Reader:UpdateReaderButton", { isArticle: false });
         break;
 
-      case "pageshow":
+      case "DOMContentLoaded":
         if (!ReaderMode.isEnabledForParseOnLoad || this.isAboutReader) {
           return;
         }
 
         let isArticle = ReaderMode.isProbablyReaderable(content.document);
         sendAsyncMessage("Reader:UpdateReaderButton", { isArticle: isArticle });
     }
   }