8000 Fix "not well-formed" error in Firefox. · GameJs/gamejs@b941a61 · GitHub
[go: up one dir, main page]

Skip to content

Commit b941a61

Browse files
author
Laurent Couvidou
committed
Fix "not well-formed" error in Firefox.
Firefox requires the mime type to be set on the XMLHttpRequest used to load javascript modules (see http://stackoverflow.com/a/677943/1005455), otherwise it spits a "not well-formed" error that pollutes the console. I'm patching Yabble directly.
1 parent b1b16ef commit b941a61

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

utils/yabbler/yabble.js

+1
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@
305305

306306
var xhr = this.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
307307
var moduleUri = resolveModuleUri(moduleId);
308+
xhr.overrideMimeType("application/json");
308309
xhr.open('GET', moduleUri, true);
309310
xhr.onreadystatechange = function() {
310311
if (xhr.readyState === 4) {

0 commit comments

Comments
 (0)
0