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.
const permissions = await pdfDocument.getPermissions();
    if (pdfDocument !== this.pdfDocument) {
      return; 
    }
    if (!permissions || !AppOptions.get("enablePermissions")) {
      return;
    }
    
    if (!permissions.includes(PermissionFlag.COPY)) {
      this.appConfig.viewerContainer.classList.add(ENABLE_PERMISSIONS_CLASS);
    }
  },
  /**
   * @private
   */
  _initializeAnnotationStorageCallbacks(pdfDocument) {
    if (pdfDocument !== this.pdfDocument) {
      return;
    }
    const { annotationStorage } = pdfDocument;
    annotationStorage.onSetModified = function () {
      window.addEventListener("beforeunload", beforeUnload);
    };
    annotationStorage.onResetModified = function () {
      window.removeEventListener("beforeunload", beforeUnload);
    };
  },
  setInitialView(