Bug 1554158 - Always consume the enter key in UrlbarInput. r=mak, a=jcristau
authorDão Gottwald <dao@mozilla.com>
Tue, 11 Jun 2019 09:27:51 +0000
changeset 536891 55b21bb55d9eda98292b0af8931222f7ef0825f2
parent 536890 a0fcf2ec279d7a5c2e72563bff25fef5f00786b1
child 536892 aac6fce419affdab022c4877a0690976d975d71a
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak, jcristau
bugs1554158
milestone68.0
Bug 1554158 - Always consume the enter key in UrlbarInput. r=mak, a=jcristau Differential Revision: https://phabricator.services.mozilla.com/D34268
browser/components/urlbar/UrlbarController.jsm
--- a/browser/components/urlbar/UrlbarController.jsm
+++ b/browser/components/urlbar/UrlbarController.jsm
@@ -280,24 +280,20 @@ class UrlbarController {
     switch (event.keyCode) {
       case KeyEvent.DOM_VK_ESCAPE:
         if (executeAction) {
           this.input.handleRevert();
         }
         event.preventDefault();
         break;
       case KeyEvent.DOM_VK_RETURN:
-        if (isMac &&
-            event.metaKey) {
-          // Prevent beep on Mac.
-          event.preventDefault();
-        }
         if (executeAction) {
           this.input.handleCommand(event);
         }
+        event.preventDefault();
         break;
       case KeyEvent.DOM_VK_TAB:
         if (this.view.isOpen) {
           if (executeAction) {
             this.userSelectionBehavior = "tab";
             this.view.selectBy(1, { reverse: event.shiftKey });
           }
           event.preventDefault();