# 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

atchIdx, queryLen)) {
        continue;
      }
      const originalMatchIdx = getOriginalIndex(matchIdx, pageDiffs),
        matchEnd = matchIdx + queryLen - 1,
        originalQueryLen =
          getOriginalIndex(matchEnd, pageDiffs) - originalMatchIdx + 1;
      matches.push(originalMatchIdx);
      matchesLength.push(originalQueryLen);
    }
    this._pageMatches[pageIndex] = matches;
    this._pageMatchesLength[pageIndex] = matchesLength;
  }
  _calculateWordMatch(query, pageIndex, pageContent, pageDiffs, entireWord) {
    const matchesWithLength = [];
    
    const queryArray = query.match(\S+g);
    for (let i = 0, len = queryArray.length; i < len; i++) {
      const subquery = queryArray[i];
      const subqueryLen = subquery.length;
      let matchIdx = -subqueryLen;
      while (true) {
        matchIdx = pageContent.indexOf(subquery, matchIdx + subqueryLen);
        if (matchIdx === -1) {
          break;
        }
        if (
          entireWord &&
          !this._isEntireWord(pageContent, matchIdx, subqueryLen)
        ) {
          continue;
        }
        const originalMatchIdx = getOriginalIndex(matchIdx, pageDiffs),
          matchEnd = matchIdx + subqueryLen - 1,
          originalQueryLen =
            getOriginalIndex(matchEnd, pageDiffs) - originalMatchIdx + 1;
        
        matchesWithLength.push({
          match: originalMatchIdx,
          matchLength: originalQueryLen,
          skipped: false,
        });
      }
    }
    
    this._pageMatchesLength[pageIndex] = [];
    this._pageMatches[pageIndex] = [];
    
    
    this._prepareMatches(
      matchesWithLength,
      this._pageMatches[pageIndex],
      this._pageMatchesLength[pageIndex]
    );
  }
  _calculateMatch(pageIndex) {
    let pageContent = this._pageContents[pageIndex];
    const pageDiffs = this._pageDiffs[pageIndex];
    let query = this._query;
    const { caseSensitive, entireWord, phraseSearch } = this._state;
    if (query.length === 0) {
      
      return