     focusedElement?.focus()
     window.parent.focus()
     UIComponentServer.postMessage {name: "unfocusIfFocused"}
+    return
 
   pasteFromClipboard: -> Utils.setTimeout TIME_TO_WAIT_FOR_IPC_MESSAGES, ->
     focusedElement = document.activeElement

    hud.appendChild countElement
    Utils.setTimeout TIME_TO_WAIT_FOR_IPC_MESSAGES, ->
      # On Firefox, the page must first be focused before the HUD input element can be focused. #3460.
      window.focus() if Utils.isFirefox()
      inputElement.focus()

    findMode =
      historyIndex: -1
      partialQuery: ""
      rawQuery: ""
      executeQuery: executeQuery

  updateMatchesCount: ({matchCount, showMatchText}) ->
    countElement = document.getElementById "hud-match-count"

onKeyEvent = (event) ->
  # Handle <Enter> on "keypress", and other events on "keydown"; this avoids interence with CJK translation
  # (see #2915 and #2934).
  if event.type == "keypress" and event.key != "Enter"
    return null
  if event.type == "keydown" and event.key == "Enter"
    return null

  inputElement = document.getElementById "hud-find-input"
  unless inputElement? # Don't do anything if we're not in find mode.
    return

  if (KeyboardUtils.isBackspace(event) and inputElement.textContent.length == 0) or
     event.key == "Enter" or KeyboardUtils.isEscape event
