Pet*_*ich 16
白名单既存在于iOS和Android上,也未出现在其他平台上.
在iOS下,它的名称为"外部主机",这里有解释: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).
Run Code Online (Sandbox Code Playgroud)
例如:
<key>ExternalHosts</key>
<array>
<string>*</string>
</array>
Run Code Online (Sandbox Code Playgroud)
对于Android,该功能目前没有记录,有些错误,虽然正在修复.该主题包含一些很好的疑难解答详情:https://groups.google.com/forum/#!topic/phonegap/9NZ4J4l1I -s
简而言之,它是xml/phonegap.xml中的"access"属性.它使用perl风格的正则表达式
To allow all domains (debugging): <access origin=".*"/>
Run Code Online (Sandbox Code Playgroud)
很快,这可能会改为以下语法:
<access origin="https://example.com" subdomains="true" />
Run Code Online (Sandbox Code Playgroud)
BlackBerry上的
白名单是作为WebWorks框架的一部分提供的,并通过config.xml进行配置:
https://bdsc.webapps.blackberry.com/html5/documentation/ww_developing/access_element_834677_11.html
示例项目允许通过"*"通配符访问所有URL.
| 归档时间: |
|
| 查看次数: |
9277 次 |
| 最近记录: |