bdkjones/CodeKit — Issue #233: Working with file:/// in Chrome
Author: TuckerWhitehouse
Created: 2012-02-24 17:54:38+00:00
State: open

In Chrome (and I believe safari as well), ajax calls cannot be made on local urls (so file:///). Not that this will effect hardly anyone, but on the off chance that you create a basic html and css/less project not running on a local web server, and you use CodeKit to compile the less file, any changes made that cause it to compile and attempt to dynamically inject in the browser will throw and error in the web console and not reload the css file.

If you could just add a line to the top of the live reload script that you use that checks for the file:/// protocol and reloads the page rather than try and ajax call, that would be perfect.

e.g. if ( location.protocol == 'file:' ) { location.reload(); return false; }