Skip to content

Commit 4426e4b

Browse files
committed
Fix for IE9 which has no XMLHttpRequest.overrideMimeType().
1 parent fb43e95 commit 4426e4b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/library.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,13 @@ LibraryManager.library = {
253253
// TODO: Use mozResponseArrayBuffer, responseStream, etc. if available.
254254
var xhr = new XMLHttpRequest();
255255
xhr.open('GET', obj.url, false);
256-
xhr.responseType = 'arraybuffer'; // hint to the browser that we want binary data
257-
xhr.overrideMimeType('text/plain; charset=x-user-defined'); // another hint
256+
257+
// Some hints to the browser that we want binary data.
258+
xhr.responseType = 'arraybuffer';
259+
if (xhr.overrideMimeType) {
260+
xhr.overrideMimeType('text/plain; charset=x-user-defined');
261+
}
262+
258263
xhr.send(null);
259264
if (xhr.status != 200 && xhr.status != 0) success = false;
260265
if (xhr.response !== undefined) {

0 commit comments

Comments
 (0)