科尔多瓦不访问外部URL
问题描述:
我想从我的科尔多瓦的应用程序访问此资源:科尔多瓦不访问外部URL
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
如果我加入这行我的应用程序崩溃。
<img src="http://192.168.1.2:8084/mobapp/api/v1.0/common/viewphoto/d4170230-6086-11e5-a98d-7bdc2a9aa3c7/0d760d00-6087-11e5-a98d-7bdc2a9aa3c7/photo_tumb" width="200px" height="200px"/>
下面是我得到ERR_TIME_OUT
错误
<img src="https://www.google.co.in/logos/doodles/2015/googles-17th-birthday-6231962352091136-hp.png" width="200px" height="200px"/>
这里是我得到ERR_NAME_NOT_RESOLVED
错误。我在config.xml中添加了<access origin="*"/>
。 我已添加cordova-plugin-whitelist 1.1.0 "Whitelist"
插件
答
您需要添加内容安全策略。这是相对较新的,并在the bottom of cutting edge documentation pages。
例子: <!-- Allow requests to foo.com --> <meta http-equiv="Content-Security-Policy" content="default-src 'self' foo.com">
更多细节,在这里#10
Top Mistakes by Developers new to Cordova/Phonegap
您需要添加*内容安全策略*。这是相对较新的,也是[尖端文档页面的底部](https://www.npmjs.com/package/cordova-plugin-whitelist)。 – JesseMonroy650
花费数小时后,我发现问题出在我的移动网络 – manish
您可以稍后为任何开发人员阅读更多细节吗?什么网络?什么是真正的原因? TIA Jesse – JesseMonroy650