hypothesis / browser-extension

The Hypothesis browser extensions.
BSD 2-Clause "Simplified" License
490 stars 128 forks source link

Some PDF pages failing to render with `DataCloneError` #626

Closed robertknight closed 3 years ago

robertknight commented 3 years ago

In Chrome 94 I've encountered a number of pages in various PDFs fail to render or render incompletely. In the browser console I see this error:

Warning: getOperatorList - ignoring errors during "GetOperatorList: page 0" task:
"DataCloneError: Failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope': 
function at() { [native code] } could not be cloned.".

This looks to me like it might relate to the recently introduced at method for strings or arrays.

If so, updating PDF.js to the latest version might fix it.

Example URLs:

https://cogcomp.seas.upenn.edu/papers/RRDA11.pdf https://files.libertyfund.org/files/869/0161_Bk.pdf

robertknight commented 3 years ago

Related upstream issue: https://github.com/mozilla/pdf.js/issues/13669.

From a comment in that thread:

The cause of this error is the, fairly recently added, Array.prototype.at() method which was fixed in PR #12924 and is included in PDF.js release 2.8.335 and up.

robertknight commented 3 years ago

This was resolved via the PDF.js update linked above.