Skip to content

Commit

Permalink
Merge pull request #16279 from Snuffleupagus/structuredClone-transfer…
Browse files Browse the repository at this point in the history
…-legacy

Skip transfers, in `LoopbackPort.postMessage`, for PDF.js `legacy`-builds (issue 16255)
  • Loading branch information
Snuffleupagus authored Apr 13, 2023
2 parents 7571842 + 82a0bce commit b3932f7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/display/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -1943,7 +1943,14 @@ class LoopbackPort {

postMessage(obj, transfer) {
const event = {
data: structuredClone(obj, transfer ? { transfer } : null),
data: structuredClone(
obj,
(typeof PDFJSDev === "undefined" ||
PDFJSDev.test("SKIP_BABEL || TESTING")) &&
transfer
? { transfer }
: null
),
};

this.#deferred.then(() => {
Expand Down

0 comments on commit b3932f7

Please sign in to comment.