phonegap 1.3.0白名单是什么状态? [英] What is the state of whitelisting in phonegap 1.3.0?

查看:24
本文介绍了phonegap 1.3.0白名单是什么状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

phonegap/callback/cordova 在所有平台上都有白名单吗?是否以相同的方式实现?

Does phonegap/callback/cordova have a whitelist on all platforms? Is it implemented the same way on each?

推荐答案

白名单在 iOS 和 Android 上都有,但在其他平台上还没有.

The whitelist is present on both iOS and Android, but not other platforms yet.

iOS 下,它的名称为外部主机",解释如下:http://wiki.phonegap.com/w/page/41631150/PhoneGap%20for%20iOS%20FAQ

Under iOS, it goes under the name of "External Hosts," which is explained here: http://wiki.phonegap.com/w/page/41631150/PhoneGap%20for%20iOS%20FAQ

Q. Links to and imported files from external hosts don't load?
A. The latest code has the new white-list feature. If you are 
referencing external hosts, you will have to add the host in PhoneGap.plist 
under the "ExternalHosts" key. Wildcards are ok. So if you are connecting to
"http://phonegap.com", you have to add "phonegap.com" to the list (or use the 
wildcard "*.phonegap.com" which will match subdomains as well).

例如:

<key>ExternalHosts</key>
<array>
    <string>*</string>
</array>


对于 Android,该功能目前未记录在案并且存在一些问题,但正在修复中.此线程包含一些很好的故障排除详细信息:https://groups.google.com/forum/#!话题/phonegap/9NZ4J4l1I-s

For Android, the feature is currently undocumented and somewhat buggy, although undergoing fixes. This thread holds some good troubleshooting details: https://groups.google.com/forum/#!topic/phonegap/9NZ4J4l1I-s

简而言之,它是 xml/phonegap.xml 中的访问"属性.它使用 perl 风格的正则表达式

In a nutshell, it is the 'access' attribute in xml/phonegap.xml. It uses perl-style regex

To allow all domains (debugging): <access origin=".*"/> 

很快,这可能会更改为以下语法:

Soon, this may be change to the following syntax:

<access origin="https://example.com" subdomains="true" />


BlackBerry 上的白名单作为 WebWorks 框架的一部分提供并通过 config.xml 进行配置:


Whitelist on BlackBerry is provided as part of the WebWorks framework and is configured via config.xml:

https://bdsc.webapps.blackberry.com/html5/documentation/ww_developing/access_element_834677_11.html

示例项目允许通过*"通配符访问所有 URL.

The sample project allows access to all URL via the "*" wild card.

这篇关于phonegap 1.3.0白名单是什么状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆