0

I am trying to load content in a WebView in my Windows Phone 8.1 RT app. As per requirement, I need to fetch the content from database and render it in the WebView. The content is essentially an HTML document (with inline javascript and CSS) saved as a string in database. It also makes connection with mobile service.

I have added * in my mobile service's CORS whitelist. I also added null after discovering that it was required for the app's android and iOS counterparts.

I am using NavigateToString() method of WebView. It is not able to fetch data from azure because it sends about: as origin in the request header (possibly from about:blank). I need to add about: in whitelist but it won't allow because it says it is not a valid hostname. I added about* with no success. What should I add in CORS whitelist now, considering I already added *?

Ajay Raghav
  • 906
  • 9
  • 16

1 Answers1

1

I'm assuming (slightly) that this is a WinJS application. It actually has nothing to do with Azure or your Mobile Service. It's got everything to do with the requirements within a WebView.

Review: https://msdn.microsoft.com/en-us/library/windows/apps/hh465373.aspx

That link provides the yes/no for your request - in a WebView you are doing a Web context. Note explicitly that you are doing Cross-Domain XHR requests are those are explicitly forbidden.

Adrian Hall
  • 7,990
  • 1
  • 18
  • 26