Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 458
marcel Avatar asked Sep 22 '16 11:09

marcel


People also ask

Does Ionic support iOS?

Because of this foundation in web technologies, Ionic can run anywhere the web runs — iOS, Android, browsers, PWAs, and more.

Is Ionic for iOS and Android?

Ionic provides a set of tools for building native iOS and Android applications, and mobile-ready Progressive Web Apps, using familiar web libraries, frameworks, and languages. Ionic Capacitor is a cross-platform native bridge that allows you to turn any web project into a native iOS or Android mobile application.

Is Ionic Angular good?

Ionic is Great For Mobile Development. Ionic makes it easy that you can develop an Android app, ios app and an web app using a single source of code. You don't need to be working differently for different platforms. But ionic will be easy only if you are comfortable with Angular JS.


1 Answers

Solution, simply add gap: to the following meta tag in index.html:

<meta http-equiv="Content-Security-Policy" content="default-src * data: cdvfile: gap:; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'"/>
like image 69
marcel Avatar answered Oct 13 '22 04:10

marcel