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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -