After update Cordova 5.0 in my system, I create new applications. When I tested my application on a device that time I get an error in the console log:
No Content-Security-Policy meta tag found.
Please add one when using the Cordova-plugin-whitelist plugin.: 23.
I add meta in the head section
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src: 'self' 'unsafe-inline' 'unsafe-eval'>
But again, I got the same error, in the application I use in-app browser plugin and 7 of other website links.
You have to add a CSP meta tag in the head section of your app's
index.html
As per https://github.com/apache/cordova-plugin-whitelist#content-security-policy
After adding the cordova-plugin-whitelist, you must tell your application to allow access all the web-page links or specific links, if you want to keep it specific.
You can simply add this to your config.xml, which can be found in your application's root directory:
Recommended in the documentation:
or:
From the plugin's documentation:
For me it was enough to reinstall whitelist plugin:
and then
It looks like updating from previous versions of Cordova was not succesful.
For me the problem was that I was using obsolete versions of the cordova android and ios platforms. So upgrading to android@5.1.1 and ios@4.0.1 solved it.
You can upgrade to these specific versions:
There are errors in your meta tag.
Yours:
Corrected:
Note the colon after "script-src", and the end double-quote of the meta tag.