If you are developing your webgl app locally using Chrome you probably have run into the problem where geometry cannot be loaded in the background using AJAX ($.get() anyone?) The reason for this is that Chrome is rather restrictive about loading resources when you work under the file:// protocol. Usually this is not a problem when you have a local web server. With a local web server you can work under http:// without any issues.

However developing without a local web server is still possible with Chrome. All you need to do is to invoke chrome from the command line passing the flag --allow-file-access-from-files

Let’s see how to accomplish this in Ubuntu Linux 12.07 , MacOS Mavericks and Windows 7:

How to do it in Ubuntu Linux 12.04

Add this alias to your .bashrc file

alias chromex='/usr/lib/chromium-browser/chromium-browser --allow-file-access-from-files'

Then reload your .bashrc file, typing the following from the terminal:

source ~/.bashrc

Then you can open chrome using the alias that you just created by typing cromex on a terminal. Make sure the flag is enabled by looking on the chrome::/version screen:

Chromium enabled for local file loading

Chromium enabled for local file loading

How to do it in MacOS Mavericks

In Mavericks the procedure is similar as in Ubuntu Linux.
Add this alias to your .bash_profile file

alias chromex='open /Applications/Google\ Chrome.app --args --allow-file-access-from-files'

Then reload your .bashrc file, typing the following from the terminal:

source ~/.bash_profile

Then you can open chrome using the alias that you just created by typing cromex on a terminal. Make sure the flag is enabled by looking on the chrome::/version screen:

Allowing local file access in Mavericks

Allowing local file access in Mavericks

How to do it in Windows 7

There are two different ways to do this in windows. The first and fastest is just to open a command prompt and write:

start chrome --allow-file-access-from-files

The second way is to create a shortcut in your desktop and modify it by adding the command line modifier like this:

Creating a shortcut to launch Chrome with local file access enabled

Creating a shortcut to launch Chrome with local file access enabled

Lastly, make sure you confirm the flag has been enabled by looking at the chrome://version screen:

Veryfing the --allow-access-from-files is enabled

Veryfing the –allow-access-from-files is enabled