Wednesday, July 4, 2012

Disabling cross-domain security check for AJAX development in Google Chrome

This tip is for those who need to test Javascript / HTML5 web application functionality against a production server from their local HTML and Javascript files (not localhost).

Start Google Chrome with no security from command lin, OSX:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security

Start Google Chrome from command line, Ubuntu/Linux:

chromium-browser --disable-web-security

After this cross-domain AJAX requests work.

Also use

–allow-file-access-from-files

Reference:
http://opensourcehacker.com/2010/11/29/disabling-cross-domain-security-check-for-ajax-development-in-google-chrome/
http://peter.sh/experiments/chromium-command-line-switches/

No comments: