Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot Display Data-URI images on PhoneGap Android App

Cannot figure this one out!

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

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

This WORKS OK on my Ipad.

I do NOT get the usual "missing image" icon, I just get a empty square.

Any ideas anyone?!

Cheers

like image 420
Ben Summerhayes Avatar asked Feb 27 '16 22:02

Ben Summerhayes


1 Answers

FIXED! 99% of the credit should go to "beaver" for steering me in the right direction

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

<meta http-equiv="Content-Security-Policy" content="img-src 'self' data:">
like image 69
Ben Summerhayes Avatar answered Nov 15 '22 08:11

Ben Summerhayes