From c515bd2c523c5ce4c3c2b77d6c18b0c25ca7f389 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Mon, 6 Aug 2012 11:47:34 -0500 Subject: [PATCH] Adds overrideMimeType for IE10 --- web/compatibility.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/web/compatibility.js b/web/compatibility.js index 4b7119c63..2b8fb8c84 100644 --- a/web/compatibility.js +++ b/web/compatibility.js @@ -127,21 +127,24 @@ // No XMLHttpRequest.response ? (function checkXMLHttpRequestResponseCompatibility() { 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 || 'mozResponseArrayBuffer' in xhrPrototype || 'mozResponse' in xhrPrototype || 'responseArrayBuffer' in xhrPrototype) return; - // IE ? + // IE9 ? if (typeof VBArray !== 'undefined') { Object.defineProperty(xhrPrototype, 'response', { get: function xmlHttpRequestResponseGet() { return new Uint8Array(new VBArray(this.responseBody).toArray()); } }); - Object.defineProperty(xhrPrototype, 'overrideMimeType', { - value: function xmlHttpRequestOverrideMimeType(mimeType) {} - }); return; }