Adds overrideMimeType for IE10
This commit is contained in:
parent
20bead2c47
commit
c515bd2c52
@ -127,21 +127,24 @@
|
|||||||
// No XMLHttpRequest.response ?
|
// No XMLHttpRequest.response ?
|
||||||
(function checkXMLHttpRequestResponseCompatibility() {
|
(function checkXMLHttpRequestResponseCompatibility() {
|
||||||
var xhrPrototype = XMLHttpRequest.prototype;
|
var xhrPrototype = XMLHttpRequest.prototype;
|
||||||
|
if (!('overrideMimeType' in xhrPrototype)) {
|
||||||
|
// IE10 might have response, but not overrideMimeType
|
||||||
|
Object.defineProperty(xhrPrototype, 'overrideMimeType', {
|
||||||
|
value: function xmlHttpRequestOverrideMimeType(mimeType) {}
|
||||||
|
});
|
||||||
|
}
|
||||||
if ('response' in xhrPrototype ||
|
if ('response' in xhrPrototype ||
|
||||||
'mozResponseArrayBuffer' in xhrPrototype ||
|
'mozResponseArrayBuffer' in xhrPrototype ||
|
||||||
'mozResponse' in xhrPrototype ||
|
'mozResponse' in xhrPrototype ||
|
||||||
'responseArrayBuffer' in xhrPrototype)
|
'responseArrayBuffer' in xhrPrototype)
|
||||||
return;
|
return;
|
||||||
// IE ?
|
// IE9 ?
|
||||||
if (typeof VBArray !== 'undefined') {
|
if (typeof VBArray !== 'undefined') {
|
||||||
Object.defineProperty(xhrPrototype, 'response', {
|
Object.defineProperty(xhrPrototype, 'response', {
|
||||||
get: function xmlHttpRequestResponseGet() {
|
get: function xmlHttpRequestResponseGet() {
|
||||||
return new Uint8Array(new VBArray(this.responseBody).toArray());
|
return new Uint8Array(new VBArray(this.responseBody).toArray());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Object.defineProperty(xhrPrototype, 'overrideMimeType', {
|
|
||||||
value: function xmlHttpRequestOverrideMimeType(mimeType) {}
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user