Bug 1148562 - Right clicking the reader mode button shouldn't trigger reader mode. r=jaws, a=sledru
authorGavin Sharp <gavin@gavinsharp.com>
Sun, 05 Apr 2015 18:50:08 -0700
changeset 258323 4406ce9ace92
parent 258322 d384bdaed2fd
child 258324 8a734418a22e
push id4645
push userryanvm@gmail.com
push date2015-04-07 15:05 +0000
treeherdermozilla-beta@8f0271f2c153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws, sledru
bugs1148562
milestone38.0
Bug 1148562 - Right clicking the reader mode button shouldn't trigger reader mode. r=jaws, a=sledru
browser/base/content/browser.xul
browser/modules/ReaderParent.jsm
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -829,17 +829,17 @@
                        onclick="gPopupBlockerObserver.onReportButtonClick(event);"/>
                 <image id="readinglist-addremove-button"
                        class="urlbar-icon"
                        hidden="true"
                        onclick="ReadingListUI.togglePageByBrowser(gBrowser.selectedBrowser);"/>
                 <image id="reader-mode-button"
                        class="urlbar-icon"
                        hidden="true"
-                       onclick="ReaderParent.toggleReaderMode(event);"/>
+                       onclick="ReaderParent.buttonClick(event);"/>
               </hbox>
               <toolbarbutton id="urlbar-go-button"
                              class="chromeclass-toolbar-additional"
                              onclick="gURLBar.handleCommand(event);"
                              tooltiptext="&goEndCap.tooltip;"/>
               <toolbarbutton id="urlbar-reload-button"
                              class="chromeclass-toolbar-additional"
                              command="Browser:ReloadOrDuplicate"
--- a/browser/modules/ReaderParent.jsm
+++ b/browser/modules/ReaderParent.jsm
@@ -152,16 +152,23 @@ let ReaderParent = {
       button.hidden = !browser.isArticle;
       let enterText = gStringBundle.GetStringFromName("readerView.enter");
       button.setAttribute("tooltiptext", enterText);
       command.setAttribute("label", enterText);
       command.setAttribute("hidden", !browser.isArticle);
     }
   },
 
+  buttonClick: function(event) {
+    if (event.button != 0) {
+      return;
+    }
+    this.toggleReaderMode(event);
+  },
+
   toggleReaderMode: function(event) {
     let win = event.target.ownerDocument.defaultView;
     let browser = win.gBrowser.selectedBrowser;
     let url = browser.currentURI.spec;
 
     if (url.startsWith("about:reader")) {
       let originalURL = this._getOriginalUrl(url);
       if (!originalURL) {