Bug 1313969 - [Follow-up] Ctrl+Click awesomebar entry with "Switch to Tab" doesn't open new tab. r?mak
MozReview-Commit-ID: 45oS37Wx5L3
--- 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[