Is there cross domain policy in a UIWebView?
Asked Answered
I

1

12

I am loading html into a UIWebView from iOS local file system. That HTML page is requesting json data on our server.

I can fetch the json data, so the question is, is there no cross domain policy in a UIWebView, or am I missing out something here?

Ichthyoid answered 29/3, 2012 at 15:18 Comment(1)
That's what makes it so useful :-)Aristotle
O
19

It's the same as desktop Safari:

  • If you're loading a local (file) url in a UIWebView then there are no cross domain restrictions

  • If you're loading external urls they'll be limited to that domain, unless the site has correct Access-Control-Allow-Origin headers set.

Odontology answered 17/4, 2012 at 15:21 Comment(1)
Do you have a reference for your first point? I'm curious to find it documented somewhere. CheersSech

© 2022 - 2024 — McMap. All rights reserved.