Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I make AJAX calls to URIs which belong to a different domain. Normally in IE I am able to do this via jQuery's CORS support. But this fails in Google Chrome irrespective where CORS support is set or not.

Now I get an error saying something like:

XMLHttpRequest cannot load . Origin http://localhost:8000 is not allowed by Access-Control-Allow-Origin.

Is there a setting in Google Chrome which disables the Access-Control-Allow-Origin restriction?

share|improve this question
1  
Do you have control over the remote web resource? You could add the Access-Control-Allow-Origin header there. –  Jacob Krall Feb 1 '12 at 20:18
add comment

1 Answer

up vote 16 down vote accepted

There is a command-line switch which does the trick: --disable-web-security

Just call it like follows:

$ chromium-browser --disable-web-security http://localhost:8000/pages/index.html

Make sure the Chrome browser is fully closed, otherwise it will only launch a new instance and the applied option will not work.

share|improve this answer
    
The --disable-web-security option doesn't seam to work on Google Chrome, only on Chromium though. –  Octavian Damiean Nov 20 '12 at 8:36
1  
Tested today in Chrome, works fine. –  munissor Nov 20 '12 at 17:14
5  
open -a Google\ Chrome --args --disable-web-security executed in the mac terminal works fine for me. It has to be done when Chrome is not running though. –  iolo Nov 21 '12 at 14:37
2  
Tested on 14-12-2012 on Chrome. Works fine but shows a message saying "You are using an unsupported command-line flag: --disable-web-security. Stability and security will suffer" –  Vivek Kodira Dec 14 '12 at 6:05
    
"Make sure the Chrome browser is fully closed" -- This was key for me. You should open task manager and make sure all the chrome.exe processes are gone. –  Jonah Aug 13 '13 at 16:34
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.