ie + file:/// = "Access denied"
Example
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>less</title>
<link rel="stylesheet/less" type="text/css" href="main.less">
<script type="text/javascript" src="less-1.1.4.js">
</script>
</head>
<body>
</body>
</html>
body
{
margin: 0;
padding: 0;
width: 100%;
height: 100%;
background-color: red;
}
Error "Access denied" when trying to open html using file protocol (file:///C:/Projects/index.html). It's work fine with ActiveXObject implemetation of XMLHttpRequest.
function getXMLHttpRequest() {
if (window.XMLHttpRequest
// This is solution?
&& !(window.ActiveXObject && isFileProtocol)
) {
return new(XMLHttpRequest);
} else {
try {
return new(ActiveXObject)("MSXML2.XMLHTTP.3.0");
} catch (e) {
log("browser doesn't support AJAX.");
return null;
}
}
}
http://stackoverflow.com/questions/2142156/read-file-urls-in-ie-xmlhttprequest/2753160#2753160
I also would like this issue to be resolved as it would enable our developpers/designers to edit less files and see the reuslts without having to run a webserver.
Unfortunately, this issue cannot be resolved by Less. Web browsers have very strict rules about arbitrary requests to the local filesystem -- for good reason. That said, Macs come preconfigured with a web server, Linux & BSD web servers are extremely easy to install, and both nginx and apache have Windows installers. On my Windows machine, I run nginx; very low memory and just a double-click of an icon to start it.
Not good news. We creating offline (local) application that uses file protocol and all major js libs works... jQuery for example with AJAX requests to local resources (files)...
@kbabintsev my apologies, I misspoke. Assuming this is the IE7/8 issue I think it is, it could be resolved in Less. I was completely mistaken with regard to local resources. Again, sorry.
I'd like to get this issue fixed too.
anyone like to suggest what that fix is?
The fix suggested in this answer looks workable, but would increase the overall number of requests in IE (though that's its fault for being broken!). To integrate it we'd need to rewrite the xhr function to work this way.
Hi, I had the same problem and I sent you another way to fix it: https://github.com/Scorpin/less.js/commit/ee2c1a1bcbd500b4d1c1aca8f84a7d4e12c9b68e
Greetings.
According to the attached Stack Overflow links, this was only an issue in IE7 / IE8. Should probably consider closing by now.
Closing as not applicable anymore (let MS care of their ancient stuff on their own).