I only browsed your PR because you've closed it, but I think it looks promising. Here's a few remarks:
It's easier for both you and me if you fork and modify https://github.com/stephanrauh/pdf.js. That's the "bleeding-edge" branch of pdf.js. Otherwise, I have to copy all your modifications of viewer*.mjs to the real source code.
I don't think it's a good idea to make private attributes public. When I merge the next version of pdf.js, these are typical merge conflicts, and often it's hard to solve them.
I'm not entirely sure what your modification does. Is it an improvement that follows the PDF standard, or is it your own solution? If we're adding stuff to the PDF viewer that only works in this PDF viewer, but fails to work in every other PDF viewer, well, that might cause trouble.
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
See analysis details on SonarCloud