diff --git a/web/compatibility.js b/web/compatibility.js index 6d57b9200..2c7776610 100644 --- a/web/compatibility.js +++ b/web/compatibility.js @@ -171,7 +171,11 @@ if (typeof PDFJS === 'undefined') { if (typeof VBArray !== 'undefined') { Object.defineProperty(xhrPrototype, 'response', { get: function xmlHttpRequestResponseGet() { - return new Uint8Array(new VBArray(this.responseBody).toArray()); + if (this.responseType === 'arraybuffer') { + return new Uint8Array(new VBArray(this.responseBody).toArray()); + } else { + return this.responseText; + } } }); return;