Created
April 6, 2014 15:05
-
-
Save candycode/10007229 to your computer and use it in GitHub Desktop.
Disable web security to access local resources as needed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM STACK OVERFLOW | |
http://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome | |
$ open -a Google\ Chrome --args --disable-web-security | |
For Linux run: | |
$ google-chrome --disable-web-security | |
Also if you're trying to access local files for dev purposes like AJAX or JSON, you can use this flag too. | |
-–allow-file-access-from-files | |
For PC go into the command prompt and go into the folder where Chrome.exe is and type | |
chrome.exe --disable-web-security | |
That should disable the same origin policy and allow you to access local files. | |
Update: For Chrome 22+ you will be presented with an error message that says: | |
You are using an unsupported command-line flag: --disable-web-security. Stability and security will suffer. | |
However you can just ignore that message while developing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For loading texture and resources from local file there is no need to disable security just use the -–allow-file-access-from-files flag.