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 266900 9d12bacce1a753ff1d5e347adfde8884aa4863db
parent 266899 9bfef867b1bba8b18a015de9c4bec61b3081eb00
child 266901 a5af953eceb9328816abe4f0580cf03d926a8987
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws, sledru
bugs1148562
milestone39.0a2
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
@@ -154,16 +154,23 @@ let ReaderParent = {
       let enterText = gStringBundle.GetStringFromName("readerView.enter");
       button.setAttribute("tooltiptext", enterText);
       command.setAttribute("label", enterText);
       command.setAttribute("hidden", !browser.isArticle);
       command.setAttribute("accesskey", gStringBundle.GetStringFromName("readerView.enter.accesskey"));
     }
   },
 
+  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) {