Skip to content

Chrome 92 Error When Using WinAnsiEncoding: function at() { [native code] } could not be cloned. #13798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tebueno opened this issue Jul 26, 2021 · 1 comment

Comments

@tebueno
Copy link

tebueno commented Jul 26, 2021

Attach (recommended) or Link to PDF file here:

Configuration:

  • Web browser and its version: 92.0.4515.107 (Official Build) (x86_64)
  • Operating system and its version: MacOs Big Sur version 11.3
  • PDF.js version: 2.4.456
  • Is a browser extension: false

Steps to reproduce the problem:
Sorry I don't have a PDF link to reproduce the issue but I can try to explain:

The breaking line of code is here:

widths[charCode] = widthsByGlyphName[encoding[charCode]];

When using WinAnsiEncoding, which has an "at" value at the 64th index.
For the font Courier (the font that this is failing for), widthsByGlyphName has always been empty for this font. This means that the above line would evaluate to []["at"], which returned nothing in Chrome 91.

In Chrome 92, however, this actually returns the function / native code because the Array prototype (for that empty array) has an at method now. This is causing failures at a later point in the stack.

As a result, the overlaying text is not getting displayed to our users.

@Snuffleupagus
Copy link
Collaborator

PDF.js version: 2.4.456

That version is no longer supported, please find the latest releases at https://mozilla.github.io/pdf.js/getting_started/#download

Steps to reproduce the problem:
Sorry I don't have a PDF link to reproduce the issue but I can try to explain:

This was possibly fixed by PR #12924, but without a test-case it's simply impossible to tell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants