locked
WebView does not load ms-appx-web contents onto HTTPS page?

    Question

  • Hello.

    I'm developing an Application which does all jobs in a main WebView.

    If I load the html page as below VIA "HTTP" scheme, the image and script resources referenced by "ms-appx-web:///" scheme are loaded properly. But VIA "HTTPS", which is mandatory to use ScriptNotify feature, the page shows no image(not showing 'X ' box, a blank box takes up the space), and doesn't load the linked JavaScript file too.

    I guess this is because the WebView doesn't allow mixed scheme contents on HTTPS page. Is it right?

    Isn't there a way to load the package resources onto HTTPS html page?

    Thank you in advance.

    <!DOCTYPE html>
     
    <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta charset="utf-8" />
        <title></title>
    </head>
    <body style="font-size:larger">
        Hello world!
        <script type="text/javascript" src="ms-appx-web:///js/jquery-1.11.1.min.js"></script>
        <img src="ms-appx-web:///img/mainTest.png" style="display:inline-block" width="300" height="200" />
    </body>
    </html>

    Sunday, June 29, 2014 7:55 AM

Answers

  • I believe that you are correct about the mixed content types.  Why aren't you loading it directly from the webserver?

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by iyij Tuesday, July 1, 2014 5:37 AM
    Monday, June 30, 2014 12:15 PM
    Moderator

All replies

  • I believe that you are correct about the mixed content types.  Why aren't you loading it directly from the webserver?

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by iyij Tuesday, July 1, 2014 5:37 AM
    Monday, June 30, 2014 12:15 PM
    Moderator
  • Thank you for your answer. 

    You are right , I could load them from my server. But I hoped there to be any un-well-known option for WebView(but known to MS engineers..:D) to allow the mixed contents in the Metro WebView for taking advantages of local contents. Actually in Android version, I used a fake 'https://***" custom url to load local contents. For now, according to your answer, seems there's no way to create a custom scheme to circumvent the https contents restriction here the WebView... I read someone suggesting an internal server for serving local contents, but also read someone saying the server caused an exceptions. Honestly, that seemed not a simple job for me...

    I spent many days already, fortunately by your quick and simple answer, feels like It would be batter to forget about local contents in this case as you said. But If anybody who knows way to load local contents into https page sees my question, please let me know and share. 

    Thank you again. 




    • Edited by iyij Tuesday, July 1, 2014 5:39 AM
    Tuesday, July 1, 2014 5:36 AM