1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Disables fetch when ReadableStream is not available.

This commit is contained in:
Yury Delendik 2017-08-30 10:53:59 -05:00
parent 3cff7da0e7
commit cd95b426c7
2 changed files with 4 additions and 2 deletions

View file

@ -80,7 +80,8 @@ function initializePDFJS(callback) {
var PDFFetchStream = modules[3].PDFFetchStream;
// Set network stream class for unit tests.
if (typeof Response !== 'undefined' && 'body' in Response.prototype) {
if (typeof Response !== 'undefined' && 'body' in Response.prototype &&
typeof ReadableStream !== 'undefined') {
displayApi.setPDFNetworkStreamClass(PDFFetchStream);
} else {
displayApi.setPDFNetworkStreamClass(PDFNetworkStream);