blackberry / BB10-WebWorks-Samples

WebWorks Samples for the BlackBerry 10 Platform
Apache License 2.0
154 stars 438 forks source link

Are there any working examples with cross origin XHR? #202

Closed arasbm closed 10 years ago

arasbm commented 10 years ago

Sorry if this is not the right channel to ask for help, but I am not able to find any working examples or get help about this issue. I am trying to run my cordova app for blackberry. The app now builds and starts in the simulator, however cross origin XHR calls fail right away. I put more details about my particular issue here: http://stackoverflow.com/q/20506440/527559

But this makes me believe that cross origin XHR is completely broken in phonegap 3.2+blackberry10. This is a pretty big deal, because many apps need this permission to run. I am hoping you can point me to a working example or provide some advice.

arasbm commented 10 years ago

Ok, I found a workaround but it is not pretty. Basically simillar to what has been done here: https://github.com/blackberry/Cordova-Samples/blob/master/BB10-Look-And-Feel/www/config.xml#L56

That did not work in cordova 3.2 but if I disable web-security using the following it will work:

<preference name="websecurity" value="disable" />

Now my question is, what are the implications of disabling web security? Does this expose my app to additional security risk over just setting access uri="*" ?

arasbm commented 10 years ago

Someone answered this question for me on stackoverflow: http://stackoverflow.com/a/20523646/527559

timwindsor commented 10 years ago

That was my boss, so it's a pretty good source for the answer :)