Sometimes an AJAX request on a page you’re developing needs to hit a server on a different domain. Web browsers’ Same-Origin Policy means (among other things) that other domains called from AJAX need to be whitelisted using the Access-Control-Allow-Origin header.
Fortunately, there’s an easier way, temporarily disable same-origin policy.
The Chrome Browsers
have a command line option
--disable-web-security which turns
off the same-origin policy. Of course you don’t want to visit web
pages out in the wild security disabled. To sandbox your browsing,
launch a separate browser. For this, I use
Google’s “bleeding edge” version. It’s not stable enough for everyday
use, but is fine for testing and different enough to remind me where I
Using a separate browser also means I don’t have to restart my browser and loose my 100 tabs (and getting Chrome to actually exit completely is harder than you’d think).
Once you’ve downloaded Chrome Canary simply launch via:
Linux (Installing Chrome Canary is a project beyond this post.):
Once Canary launches, you should see…
…and you are good to go.