       @hideMarker marker for marker in hintMarkers
       @showMarker matched, @markerMatcher.hintKeystrokeQueue.length for matched in linksMatched
 
-  #
-  # When only one link hint remains, this function activates it in the appropriate way.
-  #
+  # When only one link hint remains, this function activates it in the appropriate way.  The current frame may
+  # or may not contain the matched link, and it may or may not have the focus.  These two things are
+  # independent, so there are four possible cases.  All four cases are accounted for here by selectively
+  # pushing the appropriate onExit() handlers.
   activateLink: (linkMatched, userMightOverType=false) ->
     @removeHintMarkers()
     clickEl = HintCoordinator.getLocalHintMarker(linkMatched.hint)?.element

      {rect: hint.rect, linkText: hint.linkText, showLinkText: hint.showLinkText, hasHref: hint.hasHref,
        localIndex, frameId}

  activateLinkHintsMode: ({hints, modeIndex, frameId: activateModeFrameId}) ->
    @onExit = [] unless frameId == activateModeFrameId
    @linkHintsMode = new LinkHintsMode hints, availableModes[modeIndex]

      if document.hasFocus()
        startKeyboardBlocker -> HintCoordinator.sendMessage "exit"

    # If we're using a keyboard blocker, then the frame with the focus invokes "exit", otherwise the frame
    # containing the selected link invokes "exit".
    HintCoordinator.onExit.push => @deactivateMode()
    if userMightOverType and Settings.get "waitForEnterForFilteredHints"
      installKeyBoardBlocker (callback) -> new WaitForEnter callback
