2016-09-22 76 views
3

我在iphone上遇到了离子应用程序的问题。离子写入的index.html此:ios上的角度/离子iframe问题

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

该应用的控制台输出回路大约每秒40次这样的错误:

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

我想每次的角度的dirtycheck正在工作,该错误被抛出。 iframe来自哪里以及如何摆脱iframe和错误?

回答

8

解决方案,只需添加差距:下面的meta标签中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'"/> 
+2

这也修好了我的问题与PhoneGap的条形码扫描仪插件不加载在iOS上10! – Asier

+0

在哪里添加此行。我面临一个问题条码扫描器在iOS 10中打开。 –

+0

在index.html标题中添加/扩展此项。我使用v1.2.4-nightly-1917,它已经有一个meta标签,但它缺少'gap:'内容。 – marcel