Tested in latest Chrome and FF:

If you have multiple PDF files embedded as Iframe (via viewer.html) and at least one of them is password protected, the browser automatically jumps to the (first) iframe that shows the password prompt.

Imho, the iframe shouldn't modify the behavior of it's parent in any way.

See https://support.softcreatr.com/thread/4360-pdf-test/ for a demo.
if (typeof Stats === "undefined" || !Stats.enabled) {
    return;
  }
  const pageView = PDFViewerApplication.pdfViewer.getPageView(
     pageNumber - 1
  );
  const pageStats = pageView && pageView.pdfPage && pageView.pdfPage.stats;
  if (!pageStats) {
    return;
  }
  Stats.add(pageNumber, pageStats);
}
function webViewerInitialized() {
  const appConfig = PDFViewerApplication.appConfig;
  let file;
  if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
    const queryString = document.location.search.substring(1);
    const params = parseQueryString(queryString);
    file = "file" in params ? params.file : AppOptions.get("defaultUrl");
    validateFileURL(file);
  } else if (PDFJSDev.test("MOZCENTRAL")) {
    file = window.location.href;
  } else if (PDFJSDev.test("CHROME")) {
    file = AppOptions.get("defaultUrl");
  }
  if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
    const fileInput = document.createElement("input");
    fileInput.id = appConfig.openFileInputName;
    fileInput.className = "fileInput";