Use .overrideMimeType() for Firefox XHR

By overriding the mime type of the default XML to 'text/css' we get rid
of the automatic XML parsing and DOM building that XMLHttpRequest tries
to do whenever it gets a response.
This commit is contained in:
Kristoffer Walker 2010-06-28 14:37:33 +08:00 committed by Alexis Sellier
parent 65de5f2d89
commit 7a5e10e996

View File

@ -167,6 +167,9 @@ function xhr(url, callback, errback) {
var xhr = getXMLHttpRequest();
var async = isFileProtocol ? false : less.async;
if (typeof xhr.overrideMimeType === 'function') {
xhr.overrideMimeType('text/css');
}
xhr.open('GET', url, async);
xhr.send(null);