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 234419 5bdecf0d7d63629ec8a9ef5a99b0e11c7e03895b
parent 234418 1fd14a76c48397afc8fe9c8866f8fd7c48e5e5bb
child 234420 b467fad71782b4dad59ef6e98b20dfccb0c4f78d
push id11847
push usermleibovic@mozilla.com
push dateThu, 19 Mar 2015 17:16:47 +0000
treeherderfx-team@5bdecf0d7d63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1132674
milestone39.0a1
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 });
     }
   }