Bug 1313969 - [Follow-up] Ctrl+Click awesomebar entry with "Switch to Tab" doesn't open new tab. r=mak a=gchang
authorDrew Willcoxon <adw@mozilla.com>
Sun, 30 Oct 2016 21:42:24 -0700
changeset 356401 3c4ab75a8bcb551b4fb73f31b7a4269f05e1a0dc
parent 356400 f6db42b0ca9f6542a1c0bfe6c4102e3542d2e185
child 356402 d5b46ae42336bfeddaea1bd58a07045e4c31d890
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak, gchang
bugs1313969
milestone51.0a2
Bug 1313969 - [Follow-up] Ctrl+Click awesomebar entry with "Switch to Tab" doesn't open new tab. r=mak a=gchang MozReview-Commit-ID: 45oS37Wx5L3
browser/base/content/urlbarBindings.xml
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -992,23 +992,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[
@@ -1114,29 +1122,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[