I m building Cordova Application for Android using Cordova 5.0.0. and I m using Google Maps without Plugin and it must be without plugin. I include this script and meta tag .also Cordova using whitelist plugin.
<!-- Meta tag -->
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
<!-- Google Maps-->
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=true"></script>
it's give me this error:
Refused to load the script 'https://maps.googleapis.com/maps/api/js?sensor=true' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline' 'unsafe-eval'".
Try the using the following content-security-policy:
<meta http-equiv="Content-Security-Policy" content="
default-src 'self' data: gap:
https://ssl.gstatic.com;
script-src 'self' 'unsafe-inline' 'unsafe-eval'
https://*.gstatic.com https://*.googleapis.com;
style-src 'self' 'unsafe-inline';
media-src *">
Google maps needs the rules defined for script-src as above with 'unsafe-inline' 'unsafe-eval'. ; )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With