I am building a hybrid app (HTML,CSS, JS + Native iOS code), and Would like to make calls to a web service, but this is being blocked currently by the XSS Security.
What do I need to do to turn off this security feature (or more likely provide a whitelist that is allowed to connect?)
Thanks for the help!
I am building a hybrid app (HTML,CSS, JS + Native iOS code), and Would like to make calls to a web service, but this is being blocked currently by the XSS Security.
What do I need to do to turn off this security feature (or more likely provide a whitelist that is allowed to connect?)
Thanks for the help!
Share Improve this question asked Mar 15, 2012 at 13:33 NathanNathan 1,6474 gold badges25 silver badges46 bronze badges 4- 1 That isn't XSS. XSS is where you have a security hole which allows an attacker to add their JavaScript to your page so it runs when a visitor arrives on your site (usually via a link from the attacker). – Quentin Commented Mar 15, 2012 at 13:38
- What kind of "web service" are you talking about? What exactly are you trying, and what exactly is the browser doing to thwart your efforts? "XSS" is an attack strategy, not a security feature. – Pointy Commented Mar 15, 2012 at 13:39
- There is probably a way to expose an API written in Obj-C to your JavaScript (and your Obj-C code can make HTTP requests freely), but I'm not well versed in Apple's APIs. – Quentin Commented Mar 15, 2012 at 13:39
- See How to call Objective-C from Javascript?. It isn't specific enough about your problem to count as a duplicate, but it should give you enough to tie into an Objective C method you write to make the HTTP requests. – Quentin Commented Mar 15, 2012 at 15:01
2 Answers
Reset to default 6Yes.
You can use Cross Origin Resource Sharing, iff you're allowed to configure the server to support it, and it works on enough browsers for your needs.
No.
XSS cannot be disabled in any browser - otherwise hackers could easily steal all your money from your bank account. So this isn't a path that you can, should or want to take.
Ask another question where you describe more clearly what you need to achieve and we can probably help.