From af9a7b0003d5300ebc98a08cd3ab02204a293825 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 9 Oct 2023 09:59:11 +0200 Subject: [PATCH] Tweak `PDFWorkerUtil.createCDNWrapper` to account for JavaScript modules (PR 17055 follow-up) --- src/display/api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/display/api.js b/src/display/api.js index e3f693e54..96f1ee7ea 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -2007,7 +2007,7 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) { // We will rely on blob URL's property to specify origin. // We want this function to fail in case if createObjectURL or Blob do not // exist or fail for some reason -- our Worker creation will fail anyway. - const wrapper = `importScripts("${url}");`; + const wrapper = `await import("${url}");`; return URL.createObjectURL(new Blob([wrapper])); }; }