Bug 1417527 - Remove right click behavior as left click by checking the event.button. r=jaws draft
authorOliver <oliveralonzof@gmail.com>
Mon, 20 Nov 2017 14:22:49 -0600
changeset 700732 e795e4168200324285895162190a3bda05433c55
parent 700338 dd08f8b19cc32da161811abb2f7093e0f5392e69
child 702087 765d09a54486ae464e6b6bb03947bf6f66dc26a1
push id89954
push userbmo:oliveralonzof@gmail.com
push dateMon, 20 Nov 2017 20:30:22 +0000
reviewersjaws
bugs1417527
milestone59.0a1
Bug 1417527 - Remove right click behavior as left click by checking the event.button. r=jaws MozReview-Commit-ID: 1Fy2r5EXrU3
browser/components/preferences/in-content/containers.js
browser/components/preferences/in-content/privacy.js
browser/components/preferences/in-content/privacy.xul
--- a/browser/components/preferences/in-content/containers.js
+++ b/browser/components/preferences/in-content/containers.js
@@ -12,18 +12,20 @@ const containersBundle = Services.string
 const defaultContainerIcon = "fingerprint";
 const defaultContainerColor = "blue";
 
 let gContainersPane = {
 
   init() {
     this._list = document.getElementById("containersView");
 
-    document.getElementById("backContainersLink").addEventListener("click", function() {
-      gotoPref("general");
+    document.getElementById("backContainersLink").addEventListener("click", function(event) {
+      if (event.button == 0) {
+          gotoPref("general");
+      }
     });
 
     this._rebuildView();
   },
 
   _rebuildView() {
     const containers = ContextualIdentityService.getPublicIdentities();
     while (this._list.firstChild) {
--- a/browser/components/preferences/in-content/privacy.js
+++ b/browser/components/preferences/in-content/privacy.js
@@ -109,27 +109,39 @@ var gPrivacyPane = {
     setEventListener("browser.privatebrowsing.autostart", "change",
       gPrivacyPane.updatePrivacyMicroControls);
     setEventListener("historyMode", "command", function() {
       gPrivacyPane.updateHistoryModePane();
       gPrivacyPane.updateHistoryModePrefs();
       gPrivacyPane.updatePrivacyMicroControls();
       gPrivacyPane.updateAutostart();
     });
-    setEventListener("historyRememberClear", "click", function() {
-      gPrivacyPane.clearPrivateDataNow(false);
-      return false;
+    setEventListener("historyRememberClear", "click", function(event) {
+      if (event.button == 0) {
+          gPrivacyPane.clearPrivateDataNow(false);
+          return false;
+      }
+    });
+    setEventListener("historyRememberCookies", "click", function(event) {
+      if (event.button == 0) {
+          gPrivacyPane.showCookies();
+          return false;
+      }
     });
-    setEventListener("historyRememberCookies", "click", function() {
-      gPrivacyPane.showCookies();
-      return false;
+    setEventListener("historyDontRememberClear", "click", function(event) {
+      if (event.button == 0) {
+          gPrivacyPane.clearPrivateDataNow(true);
+          return false;
+      }
     });
-    setEventListener("historyDontRememberClear", "click", function() {
-      gPrivacyPane.clearPrivateDataNow(true);
-      return false;
+    setEventListener("openSearchEnginePreferences", "click", function(event) {
+      if (event.button == 0) {
+          gotoPref('search');
+          return false;
+      }
     });
     setEventListener("privateBrowsingAutoStart", "command",
       gPrivacyPane.updateAutostart);
     setEventListener("cookieExceptions", "command",
       gPrivacyPane.showCookieExceptions);
     setEventListener("showCookiesButton", "command",
       gPrivacyPane.showCookies);
     setEventListener("clearDataSettings", "command",
--- a/browser/components/preferences/in-content/privacy.xul
+++ b/browser/components/preferences/in-content/privacy.xul
@@ -410,17 +410,17 @@
             accesskey="&locbar.history2.accesskey;"
             preference="browser.urlbar.suggest.history"/>
   <checkbox id="bookmarkSuggestion" label="&locbar.bookmarks.label;"
             accesskey="&locbar.bookmarks.accesskey;"
             preference="browser.urlbar.suggest.bookmark"/>
   <checkbox id="openpageSuggestion" label="&locbar.openpage.label;"
             accesskey="&locbar.openpage.accesskey;"
             preference="browser.urlbar.suggest.openpage"/>
-  <label class="text-link" onclick="gotoPref('search')">
+  <label class="text-link" id="openSearchEnginePreferences">
     &suggestionSettings2.label;
   </label>
 </groupbox>
 
 <!-- Cache -->
 <groupbox id="cacheGroup" data-category="panePrivacy" hidden="true">
   <caption><label>&httpCache.label;</label></caption>