Windows 7, Linux, Mac, JavaScript, jQuery, ExtJs, Angular, .NET, Java, Android, iOS, php, mysql, lucene and more...
Thursday, May 3, 2018
How to load image on webview from ms-appdata:///local
I recently updated my Visual Studio 2015 apache cordova project to visual studio 2017. I had few problems with working with angular js otherwise everything worked in windows 10 environment.
But what I noticed was images from ms-appdata:///local folder couldn't load to img tags. I tried many ways like row html, dynamic tag creation and add url as a base64 data url.
In base64 solution it worked. But I want to get the file itself as my app was supporting iOS and Android as well.
So after trying hundred things solutions was simple. You have to set img-src option to All ( * ) Content-Security-Policy meta tag of the html file.
Please check following screen shot. You need to add the part with the read border to load image resources from any location.
Reference URL if you need to see more options.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/default-src
Subscribe to:
Post Comments (Atom)
-
I'm using following code part to access a ReST API. I'm communicating with this API using a X509 client certificate. In d...
-
Recently I purchased nord-vpn for testing. But I could not use their service due to a technical reason. So I wanted to cancel and get my mo...
-
I noticed that all events of root/home page isn't working after I have navigated back in my ionic 4 app. So if you using a back butto...
No comments:
Post a Comment