本文介绍了在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 下,其名称为外部主机,说明如下: p>

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>


strong> Android ,此功能目前未提供文档,但有些错误,但正在进行修复。此主题包含一些很好的问题排查详情:

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中的'access'属性。它使用perl式的regex

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 frameworkand is configured via config.xml:

示例项目允许通过*通配符访问所有网址。

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

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

08-24 16:15