# Configuration:
- Web browser and its version: Chrome
- Operating system and its version: MacOS
- PDF.js version: 2.6.347
- Is a browser extension: No

# Steps to reproduce the problem:
1. Implement FindBar, including Find next / Find prev buttons

# What is the expected behavior? (add screenshot)

This might be intentional but seems a bit off. The PDFFindBar findPreviousButton / findNextButton should raise an event with options that can be passed directly to PDFindController.executeCommand

What went wrong? (add screenshot)

PDFBar raises an event on the EventBus which looks like this;

`this.eventBus.dispatch("find", { query: "hello",  ... type: "again" .... });`

https://github.com/mozilla/pdf.js/blob/00b4f86db301546d21d5dc79c61e2a9a829667a4/web/pdf_find_bar.js#L93-L105
[](url)
PDFFindController expects;

`pdfFindController.executeCommand("findagain", { query: "hello" });`

Which means you can't just pass the options through because the cmd doesn't match. Is there a reason PDFFindController doesn't just accept the following?

`pdfFindController.executeCommand("find", { query: "hello", type: "again" });`

Seems like it should work this way?

Thanks

dex - 1; i >= 0; i--) {
        const prevElem = matchesWithLength[i];
        if (prevElem.skipped) {
          continue;
        }
        if (prevElem.match + prevElem.matchLength < currentElem.match) {
          break;
        }
        if (
          prevElem.match + prevElem.matchLength >=
          currentElem.match + currentElem.matchLength
        ) {
          currentElem.skipped = true;
          return true;
        }
      }
      return false;
    }
    
    
    matchesWithLength.sort(function (a, b) {
      return a.match === b.match
        ? a.matchLength - b.matchLength
        : a.match - b.match;
    });
    for (let i = 0, len = matchesWithLength.length; i < len; i++) {
      if (isSubTerm(i)) {
        continue;
      }
      matches.push(matchesWithLength[i].match);
      matchesLength.push(matchesWithLength[i].matchLength);
    }
  }
  **
   * Determine if the search query constitutes a "whole word", by comparing the
   * firstlast character type with the precedingfollowing character type.
   *
  _isEntireWord(content, startIdx, length) {
    if (startIdx > 0) {
      const first = content.charCodeAt(startIdx);
      const limit = content.charCodeAt(startIdx - 1);
      if (getCharacterType(first) === getCharacterType(limit)) {
        return false;
      }
    }
    const endIdx = startIdx + length - 1;
    if (endIdx < content.length - 1) {
      const last = content.charCodeAt(endIdx);
      const limit = content.charCodeAt(endIdx + 1);
      if (getCharacterType(last) === getCharacterType(limit)) {
        return false;
      }
    }
    return true;
  }
  _calculatePhraseMatch(query, pageIndex, pageContent, pageDiffs, entireWord) {
    const matches = [],
      matchesLength = [];
    const queryLen = query.length;
    let matchIdx = -queryLen;
    while (true) {
      matchIdx = pageContent.indexOf(query, matchIdx + queryLen);
      if (matchIdx === -1) {
        break;
      }
      if (entireWord && !this._isEntireWord(pageContent, m