From 7a5e10e996a2007b792fe78ae185fb0f0de22a04 Mon Sep 17 00:00:00 2001 From: Kristoffer Walker Date: Mon, 28 Jun 2010 14:37:33 +0800 Subject: [PATCH] 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. --- lib/less/browser.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/less/browser.js b/lib/less/browser.js index 544ec5a..2ad71ff 100644 --- a/lib/less/browser.js +++ b/lib/less/browser.js @@ -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);