Skip to content

Commit a23f159

Browse files
committed
[api-minor] Remove the, now unused, pdfjsLibPromise global
1 parent 2643570 commit a23f159

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

gulpfile.mjs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -445,10 +445,8 @@ function checkChromePreferencesFile(chromePrefsPath, webPrefs) {
445445

446446
function tweakWebpackOutput(jsName) {
447447
const replacer = [
448-
" __webpack_exports__ = {};",
449-
",__webpack_exports__={};",
450-
" __webpack_exports__ = await __webpack_exports__;",
451-
"\\(__webpack_exports__=await __webpack_exports__\\)",
448+
" __webpack_exports__ = {};", // Normal builds.
449+
",__webpack_exports__={};", // Minified builds.
452450
];
453451
const regex = new RegExp(`(${replacer.join("|")})`, "gm");
454452

@@ -458,10 +456,6 @@ function tweakWebpackOutput(jsName) {
458456
return ` __webpack_exports__ = globalThis.${jsName} = {};`;
459457
case ",__webpack_exports__={};":
460458
return `,__webpack_exports__=globalThis.${jsName}={};`;
461-
case " __webpack_exports__ = await __webpack_exports__;":
462-
return ` __webpack_exports__ = globalThis.${jsName} = await (globalThis.${jsName}Promise = __webpack_exports__);`;
463-
case "(__webpack_exports__=await __webpack_exports__)":
464-
return `(__webpack_exports__=globalThis.${jsName}=await (globalThis.${jsName}Promise=__webpack_exports__))`;
465459
}
466460
return match;
467461
});

web/pdfjs.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,6 @@
1313
* limitations under the License.
1414
*/
1515

16-
// Ensure that the viewer waits for the library to complete loading,
17-
// to avoid breaking e.g. the standalone viewer components (see issue 17228).
18-
if (
19-
(typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) &&
20-
!globalThis.pdfjsLib
21-
) {
22-
await globalThis.pdfjsLibPromise;
23-
}
24-
2516
const {
2617
AbortException,
2718
AnnotationEditorLayer,

0 commit comments

Comments
 (0)