Unable to display data URI images in Android PhoneGap application

Can't figure it out!

<img width="16" height="16" src="data:image/jpg;base64,/9j/4AAQSk......pHz7in//2Q=="> 

This works as expected in all browsers. However, when I compile it using the desktop version of PhoneGap (ios) and then use the PhoneGap application on my Android mobile phone (Nexus 6P V6.0.1), the image will not be displayed.

This WORKS OK on my iPad.

I don’t get the usual “missing image” icon, I just get an empty square.

Any ideas anybody ?!

Greetings

+5
source share
1 answer

FIXED! 99% of the loan should be sent to the "beaver" to drive me in the right direction.

All I had to do was add the following to the index.html header:

 <meta http-equiv="Content-Security-Policy" content="img-src 'self' data:"> 
+6
source

Source: https://habr.com/ru/post/1244025/


All Articles