mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #14171 from Snuffleupagus/issue-14170
Prevent run-time errors in Node.js versions with `URL.createObjectURL` support (issue 14170)
This commit is contained in:
commit
11f030d301
2 changed files with 6 additions and 2 deletions
|
@ -1030,7 +1030,7 @@ function createPromiseCapability() {
|
|||
}
|
||||
|
||||
function createObjectURL(data, contentType = "", forceDataSchema = false) {
|
||||
if (URL.createObjectURL && !forceDataSchema) {
|
||||
if (URL.createObjectURL && typeof Blob !== "undefined" && !forceDataSchema) {
|
||||
return URL.createObjectURL(new Blob([data], { type: contentType }));
|
||||
}
|
||||
// Blob/createObjectURL is not available, falling back to data schema.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue