[Pkg-javascript-commits] [less.js] 80/88: use the right xml http request for local file access. from @Scorpin

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:22:28 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag v1.7.0
in repository less.js.

commit fce001e088c03313dc85d91b335a8223030dc8f7
Author: Luke Page <luke.a.page at gmail.com>
Date:   Sun Feb 23 16:41:39 2014 +0000

    use the right xml http request for local file access. from @Scorpin
---
 lib/less/browser.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/less/browser.js b/lib/less/browser.js
index dcfe498..613a22e 100644
--- a/lib/less/browser.js
+++ b/lib/less/browser.js
@@ -411,12 +411,12 @@ function pathDiff(url, baseUrl) {
 }
 
 function getXMLHttpRequest() {
-    if (window.XMLHttpRequest) {
+    if (window.XMLHttpRequest && (window.location.protocol !== "file:" || !window.ActiveXObject)) {
         return new XMLHttpRequest();
     } else {
         try {
             /*global ActiveXObject */
-            return new ActiveXObject("MSXML2.XMLHTTP.3.0");
+            return new ActiveXObject("Microsoft.XMLHTTP");
         } catch (e) {
             log("browser doesn't support AJAX.", logLevel.errors);
             return null;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git



More information about the Pkg-javascript-commits mailing list