getElementToNavigate(linkOnly = false) {
    const focusedElement = document.activeElement;
    // StartPage seems to still focus and change it to body when the page loads.
    if (focusedElement == null || focusedElement.localName === 'body') {
      if (
        this.focusedIndex < 0 ||
        this.focusedIndex >= this.searchResults.length
      ) {
        return null;
      }
      return this.searchResults[this.focusedIndex].anchor;
    }
    const isLink =
      focusedElement.localName === 'a' && focusedElement.hasAttribute('href');
    if (!linkOnly || isLink) {
      return focusedElement;
    }
  }
Returns the element to click on upon navigation. The focused element in the
document is preferred (if there is one) over the highlighted result. Note
that the focused element does not have to be an anchor <a> element.

@param {boolean} linkOnly If true the focused element is preferred only
when it is a link with "href" attribute.
@return {Element}