javascript - Apache Cordova: CSP Error -
i have problem android 5.0 lollipop , google maps api, have csp error of unsafe-eval.
here error:
https://maps.googleapis.com/maps-api-v3/api/js/22/7/intl/es_all/main.js:65
uncaught evalerror: refused evaluate string javascript because 'unsafe-eval' not allowed source of script in following content security policy directive: "default-src * 'unsafe-inline'".
the code:
<meta http-equiv="content-security-policy" content="default-src * 'unsafe-inline'; style-src 'self' 'unsafe-inline'; script-src: 'self' 'unsafe-inline' 'unsafe-eval'">
inside config.xml have this:
<plugin name="cordova-plugin-whitelist" version="1" /> <access origin="*" />
i have no problems android 4.x 5.x, know it's because of chromium webview can't use google maps because of error.
what can fix ?
thanks !
try refactoring content-security-policy meta tag little, have following working in cordova 5 / android 5 app uses google maps (; positions different yours:
<meta http-equiv="content-security-policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
Comments
Post a Comment