No content security policy meta?


#1

I was running on emulator android and it throws this error

0 820714 error No Content-Security-Policy meta tag found. Please add one when using the cordova-plugin-whitelist plugin.

I tried to find solution for adding this line below in index.html

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

or below for test in config.xml

 <allow-navigation href="http://*/*" />

both does not seems to help.


#2

Have you included Cordova Whitelist Plugin?

This will not work without it.

Find more about it here: http://www.gajotres.net/whitelist-external-resources-and-api-calls-ionic-framework/


#3

@Gajotres Yes, I did included that plugin and as I put the meta html element to index.html.

0 922133 error Error: Can’t find variable: google
link@http://192.168.0.4:8100/js/map/map.directive.js:23:29
invokeLinkFn@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:17046:15
nodeLinkFn@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:16556:23
compositeLinkFn@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:15905:23
nodeLinkFn@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:16551:35
compositeLinkFn@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:15905:23
nodeLinkFn@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:16551:35
compositeLinkFn@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:15905:23
publicLinkFn@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:15784:45
appendViewElement@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:48439:11
render@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:46629:58
init@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:46549:26
render@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:48295:18
register@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:48253:16
updateView@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:53645:31
http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:53629:19
invokeLinkFn@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:17046:15
nodeLinkFn@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:16556:23
compositeLinkFn@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:15905:23
publicLinkFn@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:15784:45
tabSelected@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:55011:37
$digest@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:23070:31
$apply@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:23333:31
done@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:18486:53
completeRequest@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:18676:15
requestLoaded@http://192.168.0.4:8100/lib/ionic/js/ionic.bundle.js:18617:24,

I guess I have to explicitly include google.com to the meta element somehow?


#4

@fkkcloud Are you still receiving the same error?


#5

@Gajotres yes, only when I included that meta element that link provided. only for android though.

for ios, I am having different problem : When its running without "-l", it can't find files in /img or /templates