Bug 1148562: right clicking the reader mode button shouldn't trigger reader mode, r=jaws
authorGavin Sharp <gavin@gavinsharp.com>
Sun, 05 Apr 2015 18:50:08 -0700
changeset 237723 ca6b765f41db
parent 237688 4fe763cbe196
child 237724 7faa8f366cab
push id28548
push userryanvm@gmail.com
push dateMon, 06 Apr 2015 22:47:26 +0000
treeherdermozilla-central@a530b5c3b713 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1148562
milestone40.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 1148562: right clicking the reader mode button shouldn't trigger reader mode, r=jaws
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) {