locked
Issue with HTTPS in an Iframe

    Question

  • I want to show a message at the begining of my app, and since I cant update it (it is a beta outside the store), i thought I could embed an iframe and load the content from my server. I have successfully created the iframe and been able to display webpages as bing.com, but I'm not able to show my own webpage.

    I must add the domain to the Content URI list, but I can only add HTTPS uris. If i try to acess my server through HTTPS , I get a INVALID_CERTIFICATE error, and it seems that I am not allowed to load HTTP pages. What can I do?

    Monday, March 10, 2014 9:49 PM

Answers

  • Hi ArcadioGarcia,

    Have you tried with x-ms-webview element?

    IFRAME elements within Windows Store apps using JavaScript and not within WebView controls can’t navigate to HTTP web sites. An IFRAME can navigate only to packaged content or HTTPS URIs listed in the ApplicationContentURI rules. WebView can support HTTP.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by ArcadioGarcia Wednesday, March 12, 2014 10:14 AM
    Tuesday, March 11, 2014 6:27 AM
    Moderator

All replies

  • Hi ArcadioGarcia,

    Have you tried with x-ms-webview element?

    IFRAME elements within Windows Store apps using JavaScript and not within WebView controls can’t navigate to HTTP web sites. An IFRAME can navigate only to packaged content or HTTPS URIs listed in the ApplicationContentURI rules. WebView can support HTTP.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by ArcadioGarcia Wednesday, March 12, 2014 10:14 AM
    Tuesday, March 11, 2014 6:27 AM
    Moderator
  • Thanks! It works perfectly, but I have realized that I cannot use window.external.notify() from an HTTP page. Is there a workaround (like using links for the parent element or something like that) or I must use HTTPS? In that case, how can I remove the INVALID_CERTIFICATE error?
    Tuesday, March 11, 2014 4:20 PM
  • Use invokeScriptAsync method?

    However I think it is possible to use window.external.notify() for the HTTP file in your app package (See the sample: http://code.msdn.microsoft.com/windowsapps/HTML-WebView-control-sample-56e773fascenario 6th), but for the pages on the Internet, HTTPS is required. You must include the page's URI in the ApplicationContentUriRules section of the app manifest. (You can do this in Visual Studio on the Content URIs tab of the Package.appxmanifest designer.)

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Wednesday, March 12, 2014 4:31 AM
    Moderator