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.
}
    } catch (ex) {
      const message = ex && ex.message;
      PDFViewerApplication.l10n
        .get("loading_error", null, "An error occurred while loading the PDF.")
        .then(loadingErrorMessage => {
          PDFViewerApplication.error(loadingErrorMessage, { message });
        });
      throw ex;
    }
  };
}
async function loadFakeWorker() {
  if (!GlobalWorkerOptions.workerSrc) {
    GlobalWorkerOptions.workerSrc = AppOptions.get("workerSrc");
  }
  if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("PRODUCTION")) {
    window.pdfjsWorker = await import("pdfjs/core/worker.js");
    return undefined;
  }
  return loadScript(PDFWorker.getWorkerSrc());
}
function loadAndEnablePDFBug(enabledTabs) {
  const appConfig = PDFViewerApplication.appConfig;
  return loadScript(appConfig.debuggerScriptPath).then(function () {
    PDFBug.enable(enabledTabs);
    PDFBug.init({ OPS }, appConfig.mainContainer);
  });
}
function reportPageStatsPDFBug({ pageNumber }) {