# 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

* Copyright 2012 Mozilla Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http:www.apache.orglicensesLICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
import { createPromiseCapability } from "pdfjs-lib";
import { getCharacterType } from ".pdf_find_utils.js";
import { scrollIntoView } from ".ui_utils.js";
const FindState = {
  FOUND: 0,
  NOT_FOUND: 1,
  WRAPPED: 2,
  PENDING: 3,
};
const FIND_TIMEOUT = 250; 
const MATCH_SCROLL_OFFSET_TOP = -50; 
const MATCH_SCROLL_OFFSET_LEFT = -400; 
const CHARACTERS_TO_NORMALIZE = {
  "\u2010": "-", 
  "\u2018": "'", 
  "\u2019": "'", 
  "\u201A": "'", 
  "\u201B": "'", 
  "\u201C": '"', 
  "\u201D": '"', 
  "\u201E": '"', 
  "\u201F": '"', 
  "\u00BC": "14", 
  "\u00BD": "12", 
  "\u00BE": "34", 
};
let normalizationRegex = null;
function normalize(text) {
  if (!normalizationRegex) {
    
    const replace = Object.keys(CHARACTERS_TO_NORMALIZE).join("");
    normalizationRegex = new RegExp(`[${replace}]`, "g");
  }
  let diffs = null;
  const normalizedText = text.replace(normalizationRegex, function (ch, index) {
    const normalizedCh = CHARACTERS_TO_NORMALIZE[ch],
      diff = normalizedCh.length - ch.length;
    if (diff !== 0) {
      (diffs ||= []).push([index, diff]);
    }
    return normalizedCh;
  });
  return [normalizedText, diffs];
}
function getOriginalIndex(matchIndex, diffs = null) {
  if (!diffs) {
    return matchIndex;
  }
  let totalDiff = 0;
  for (const [index, diff] of diffs) {
    const currentIndex = index + totalDiff;
    if (currentIndex >= matchIndex) {
      break;
 