2

I'm developing a native iOs app using cordova to do the native stuff, so I can focus on html/javascript and css. However, I need to make cross-domain ajax calls, which is fine in my native app, but not when I run my project in Chrome. So I would like to disable this security feature in Chrome so I can test my app. Is there an easy way to do this ?

Cheers

2 Answers 2

2

Given you are developing an iOS app I assume you are on OSX in which case you can essentially launch Chrome with XXS enabled be executing the following command line:

open -a "Google Chrome" --args --disable-web-security

In fact, I use it so often I added an alias in my .bash_profile:

alias chrometest='open -a "Google Chrome" --args --disable-web-security'

This has been working for me for quite some time all the way up to my current version of Chrome: 38.0.2125.104

Of course you can name it whatever you like…good luck!!!

0

You can do jsonp for your cross domain requests.

Or another trick is modifying the server headers to allow cross site ajax.

Access-Control-Allow-Origin: *

From cors

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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