Friday, January 25, 2013

Chrome local file access

I've been doing some things at work on a webpage for Chrome Desktop, Chrome Android and Safari. We basically need to present the same 3D content across all of these browsers.

When testing Chrome, for security reasons you cannot run pages that will load local content. There are several fixes to this. The quickest is to run Chrome with a specific argument to disable the security feature. I won't describe that fix as it isn't a good idea.

No, the good idea is to run the site you're working on via a local server. It's also very easy to do.


  • Download the latest version of Python 2.X
  • Open up the command prompt or terminal and go to the folder with the site's index.html.
  • Once in this folder, run the command [python -m SimpleHTTPServer].
  • Your folder's contents will be hosted at the web address [http://localhost:8000].
And that's it! You can safely dev your site on this python local host now. When you are done just close the terminal (or press ctrl+c in the terminal).

Remember to launch the server from the terminal once it is in the folder with the site's index.html.

No comments:

Post a Comment