Merge pull request #13158 from Snuffleupagus/rm-URL-polyfill

Remove the `URL` polyfill
This commit is contained in:
Tim van der Meij 2021-03-31 20:22:02 +02:00 committed by GitHub
commit 2fb4d02ea5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,24 +74,6 @@ if (
globalThis.Promise = require("core-js/es/promise/index.js");
})();
// Support: Safari
(function checkURL() {
if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("PRODUCTION")) {
// Prevent "require is not a function" errors in development mode,
// since the `URL` constructor should be available in modern browers.
return;
} else if (!PDFJSDev.test("GENERIC")) {
// The `URL` constructor is assumed to be available in the extension
// builds.
return;
} else if (PDFJSDev.test("IMAGE_DECODERS")) {
// The current image decoders don't use the `URL` constructor, so it
// doesn't need to be polyfilled for the IMAGE_DECODERS build target.
return;
}
globalThis.URL = require("core-js/web/url.js");
})();
// Support: Safari<10.1, Node.js
(function checkReadableStream() {
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("IMAGE_DECODERS")) {