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,


super(data);
    
    
    this._expandos = globalThis;
    this._baseURL = data.baseURL || "";
    this._calculate = true;
    this._delay = false;
    this._dirty = false;
    this._disclosed = false;
    this._media = undefined;
    this._metadata = data.metadata || "";
    this._noautocomplete = undefined;
    this._nocache = undefined;
    this._spellDictionaryOrder = [];
    this._spellLanguageOrder = [];
    this._printParams = null;
    this._fields = new Map();
    this._fieldNames = [];
    this._event = null;
    this._author = data.Author || "";
    this._creator = data.Creator || "";
    this._creationDate = this._getDate(data.CreationDate) || null;
    this._docID = data.docID || ["", ""];
    this._documentFileName = data.filename || "";
    this._filesize = data.filesize || 0;
    this._keywords = data.Keywords || "";
    this._layout = data.layout || "";
    this._modDate = this._getDate(data.ModDate) || null;
    this._numFields = 0;
    this._numPages = data.numPages || 1;