【发布时间】:2019-03-05 02:53:19
【问题描述】:
我正在使用 cordova 开发一个应用程序,无论如何,每当我在 Android 上运行该应用程序时,youtube iframe 都不会加载。我已经尝试了我在这里和其他网站上看到的几件事,例如更改白名单、向元标记“Content-Security-Policy”添加参数、更改配置文件......对我来说没有任何效果.我对这个问题有点沮丧。我知道这个问题与科尔多瓦不让其他网站出于安全目的在应用程序上显示数据有关,但我不知道如何使它工作。如果有人可以帮助我解决这个问题,我将非常感激。
这是我的 Content-Security-Policy 元标记:
<meta http-equiv="Content-Security-Policy" script-src='unsafe-inline'>
这是我的配置文件
<content src="index.html" />
<access origin="*" />
<allow-navigation href="https://*youtube.com/*"/>
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<plugin name="cordova-plugin-device" spec="^2.0.2" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
<plugin name="cordova-plugin-browsersync" spec="^1.1.0" />
配置文件有默认行,但正如我之前所说,我已经尝试了我创建的所有内容。帮助!
【问题讨论】:
标签: cordova iframe phonegap whitelist