marcel marcel - 10 months ago 113
AngularJS Question

angular/ionic iframe issue on ios

I have an issue with my ionic app on iphone. Ionic writes this into the index.html:

<iframe src="gap://ready" style="display:none;">...</iframe>

The console output of the app loops this error about 40 times per second:

Refused to load gap://ready because it appears in neither the child-src directive nor the default-src directive of the Content Security Policy.

I guess everytime the dirtycheck of angular is working, this error is thrown. Where is the iframe comming from and how can I get rid of the iframe and the error?

Answer Source

Solution, simply add gap: to the following meta tag in config.xml:

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