Disables fetch when ReadableStream is not available.
This commit is contained in:
parent
3cff7da0e7
commit
cd95b426c7
@ -34,7 +34,8 @@ if (typeof PDFJSDev === 'undefined' ||
|
||||
if (pdfjsSharedUtil.isNodeJS()) {
|
||||
var PDFNodeStream = require('./display/node_stream.js').PDFNodeStream;
|
||||
pdfjsDisplayAPI.setPDFNetworkStreamClass(PDFNodeStream);
|
||||
} else if (typeof Response !== 'undefined' && 'body' in Response.prototype) {
|
||||
} else if (typeof Response !== 'undefined' && 'body' in Response.prototype &&
|
||||
typeof ReadableStream !== 'undefined') {
|
||||
var PDFFetchStream = require('./display/fetch_stream.js').PDFFetchStream;
|
||||
pdfjsDisplayAPI.setPDFNetworkStreamClass(PDFFetchStream);
|
||||
} else {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user