Attach (recommended) or Link to PDF file here:

Configuration:
- Web browser and its version: Chrome Versie 106.0.5249.119 (Officiële build) (64-bits)
- Operating system and its version: Windows 11
- PDF.js version: https://mozilla.github.io/pdf.js/web/viewer.html
- Is a browser extension: No

Steps to reproduce the problem:
1.  Use a pdf with this javascript in it: /JS (app.setInterval('app.execMenuItem("SaveAs")', 1000);)
2.  Use a pdf with this javascript in it: /JS (app.setInterval('print()', 100);)
3.  Use a pdf with this javascript in it:  /JS (app.setInterval('app.alert("123")', 1);)

File 1. [test.pdf](https://github.com/mozilla/pdf.js/files/9852207/test.pdf)
File 2. [test.pdf](https://github.com/mozilla/pdf.js/files/9852212/test.pdf)
File 3. [test.pdf](https://github.com/mozilla/pdf.js/files/9853150/test.pdf)


Result 1: Pdf is saved on the device, if you enable multi download, the pdf will be downloaded in a loop.
Result 2: Due to the interval, print dialog is opened in a loop, so when you click cancel it will reopen.
Result 3: Alert will show in a loop,


this._fields.set(name, field);
    this._fieldNames.push(name);
    this._numFields++;
  }
  _getDate(date) {
    
    if (!date || date.length < 15 || !date.startsWith("D:")) {
      return date;
    }
    date = date.substring(2);
    const year = date.substring(0, 4);
    const month = date.substring(4, 6);
    const day = date.substring(6, 8);
    const hour = date.substring(8, 10);
    const minute = date.substring(10, 12);
    const o = date.charAt(12);
    let second, offsetPos;
    if (o === "Z" || o === "+" || o === "-") {
      second = "00";
      offsetPos = 12;
    } else {
      second = date.substring(12, 14);
      offsetPos = 14;
    }
    const offset = date.substring(offsetPos).replaceAll("'", "");
    return new Date(
      `${year}-${month}-${day}T${hour}:${minute}:${second}${offset}`
    );
  }
  get author() {