The app works on browser but fails on android


#1

Hello guys, my app works fine in the browser with the command Ionic serve, but when I build and install it on my device all the requests doesn’t work. I tried to install cordova whitelist plugin but raises the error bellow:

Refused to load the script ‘http://www.parsecdn.com/js/parse-1.4.2.min.js’ because it violates the following Content Security Policy directive: “script-src ‘self’ ‘unsafe-inline’ ‘unsafe-eval’”.

(index):72 Refused to load the script 'http://localhost:35729/livereload.js?snipver=1' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline' 'unsafe-eval'".
(anonymous function) @ (index):72
app.js:7 Uncaught ReferenceError: Parse is not defined

I’m using cordova 5.1.1 and my index.html contains the tag

<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">

I don’t know whats wrong


#2

Best place I’ve found explaining Content-Security-Policy: https://scotthelme.co.uk/content-security-policy-an-introduction/
It explains common mistakes…