Skip to content

Commit c515bd2

Browse files
committed
Adds overrideMimeType for IE10
1 parent 20bead2 commit c515bd2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

web/compatibility.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,21 +127,24 @@
127127
// No XMLHttpRequest.response ?
128128
(function checkXMLHttpRequestResponseCompatibility() {
129129
var xhrPrototype = XMLHttpRequest.prototype;
130+
if (!('overrideMimeType' in xhrPrototype)) {
131+
// IE10 might have response, but not overrideMimeType
132+
Object.defineProperty(xhrPrototype, 'overrideMimeType', {
133+
value: function xmlHttpRequestOverrideMimeType(mimeType) {}
134+
});
135+
}
130136
if ('response' in xhrPrototype ||
131137
'mozResponseArrayBuffer' in xhrPrototype ||
132138
'mozResponse' in xhrPrototype ||
133139
'responseArrayBuffer' in xhrPrototype)
134140
return;
135-
// IE ?
141+
// IE9 ?
136142
if (typeof VBArray !== 'undefined') {
137143
Object.defineProperty(xhrPrototype, 'response', {
138144
get: function xmlHttpRequestResponseGet() {
139145
return new Uint8Array(new VBArray(this.responseBody).toArray());
140146
}
141147
});
142-
Object.defineProperty(xhrPrototype, 'overrideMimeType', {
143-
value: function xmlHttpRequestOverrideMimeType(mimeType) {}
144-
});
145148
return;
146149
}
147150

0 commit comments

Comments
 (0)