Browse Source

only convert in IE9 if the requested responseType is actually an arraybuffer, otherwise just return the responseText. That way the compatibility.js does not break other frameworks like angular that not always want an array from xhr requests.

Tom De Wolf 11 years ago
parent
commit
a265861ba6
  1. 4
      web/compatibility.js

4
web/compatibility.js

@ -171,7 +171,11 @@ if (typeof PDFJS === 'undefined') { @@ -171,7 +171,11 @@ if (typeof PDFJS === 'undefined') {
if (typeof VBArray !== 'undefined') {
Object.defineProperty(xhrPrototype, 'response', {
get: function xmlHttpRequestResponseGet() {
if (this.responseType === 'arraybuffer') {
return new Uint8Array(new VBArray(this.responseBody).toArray());
} else {
return this.responseText;
}
}
});
return;

Loading…
Cancel
Save