Bug 1313969 - [Follow-up] Ctrl+Click awesomebar entry with "Switch to Tab" doesn't open new tab. r?mak draft
authorDrew Willcoxon <adw@mozilla.com>
Sun, 30 Oct 2016 21:42:24 -0700
changeset 431689 570ea2eb93ffe99218ad2b6c82ee0436ec9bef34
parent 430552 10a2b6ebcd44a3516673f51da14b760de7fd3bc0
child 535439 6161293207e832c76fa3ace2a826cf2f085cf297
push id34080
push userdwillcoxon@mozilla.com
push dateMon, 31 Oct 2016 04:42:44 +0000
reviewersmak
bugs1313969
milestone52.0a1
Bug 1313969 - [Follow-up] Ctrl+Click awesomebar entry with "Switch to Tab" doesn't open new tab. r?mak MozReview-Commit-ID: 45oS37Wx5L3
browser/base/content/urlbarBindings.xml
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -995,23 +995,31 @@ file, You can obtain one at http://mozil
               action.params.displayUrl = action.params.url;
             }
           }
 
           return action;
         ]]></body>
       </method>
 
-      <field name="_noActionKeys"><![CDATA[
-        [
-          KeyEvent.DOM_VK_ALT,
-          KeyEvent.DOM_VK_SHIFT,
-          KeyEvent.DOM_VK_META,
-        ]
-      ]]></field>
+      <property name="_noActionKeys" readonly="true">
+        <getter><![CDATA[
+          if (!this.__noActionKeys) {
+            this.__noActionKeys = new Set([
+              KeyEvent.DOM_VK_ALT,
+              KeyEvent.DOM_VK_SHIFT,
+            ]);
+            let modifier = this.AppConstants.platform == "macosx" ?
+                           KeyEvent.DOM_VK_META :
+                           KeyEvent.DOM_VK_CONTROL;
+            this.__noActionKeys.add(modifier);
+          }
+          return this.__noActionKeys;
+        ]]></getter>
+      </property>
 
       <field name="_pressedNoActionKeys"><![CDATA[
         new Set()
       ]]></field>
 
       <method name="_clearNoActions">
         <parameter name="aURL"/>
         <body><![CDATA[
@@ -1117,29 +1125,29 @@ file, You can obtain one at http://mozil
                  this._prefs.getIntPref("daysBeforeHidingSuggestionsPrompt");
         ]]></getter>
       </property>
 
     </implementation>
 
     <handlers>
       <handler event="keydown"><![CDATA[
-        if (this._noActionKeys.includes(event.keyCode) &&
+        if (this._noActionKeys.has(event.keyCode) &&
             this.popup.selectedIndex >= 0 &&
             !this._pressedNoActionKeys.has(event.keyCode)) {
           if (this._pressedNoActionKeys.size == 0) {
             this.popup.setAttribute("noactions", "true");
             this.removeAttribute("actiontype");
           }
           this._pressedNoActionKeys.add(event.keyCode);
         }
       ]]></handler>
 
       <handler event="keyup"><![CDATA[
-        if (this._noActionKeys.includes(event.keyCode) &&
+        if (this._noActionKeys.has(event.keyCode) &&
             this._pressedNoActionKeys.has(event.keyCode)) {
           this._pressedNoActionKeys.delete(event.keyCode);
           if (this._pressedNoActionKeys.size == 0)
             this._clearNoActions();
         }
       ]]></handler>
 
       <handler event="focus"><![CDATA[