locked
Angular image src injection in WinRT app webview

    Question

  • Hi, I am developing winrt 8.1 app with webview component.

    I am using angular on the webview content.

    I have a problem with setting the image (html control) source as angular binding...The source is injected by angular controller and I get this prefix in the inage src:

    Prefix:

    "unsafe:ms-local-stream://01010101-0101-0101-0101-0101010101212_64656d6f32"

    Full path:

    unsafe:ms-local-stream://01010101-0101-0101-0101-0101010101212_64656d6f32/test.png.

    If I am changing the path to the "test.png" manually (removing the "unsafe" prefix), with the DOM Explorer - then the image appears. But when it's injected I get this prefix that shows no image since the path is not found on the LocalFolder.

    how can I disable this behavior?


    Thursday, April 16, 2015 2:26 PM

All replies

  • Hi Pavel,

         I really don't understand why that prefix would exist.  How exactly is it injecting that URL?


    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.

    Thursday, April 16, 2015 7:43 PM
    Moderator
  • The image source is injected by angular.

    <img src="{{cover}}"/>

    If the source is static : 

    <img src="test.jpg"/> 

    It works, but as the same src replaced with injection , it gets this prefix...

    Usually webview is very restricted with dynamic content, i had problems with dynamic html injection when I used Angular on WinJS.

    Sunday, April 19, 2015 5:18 AM
  • Sorry, I don't know why angular does any of that. I think you need to ask on a forum which supports Angular JS.

    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.

    Monday, April 20, 2015 3:25 PM
    Moderator