5

phonegap/callback/cordova にはすべてのプラットフォームでホワイトリストがありますか? それぞれに同じ方法で実装されていますか?

4

1 に答える 1

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).

例えば:

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


Androidの場合、この機能は現在文書化されておらず、多少バグがありますが、修正中です。このスレッドには、トラブルシューティングの詳細が記載されています: https://groups.google.com/forum/#!topic/phonegap/9NZ4J4l1I-s

簡単に言えば、xml/phonegap.xml の「access」属性です。perl スタイルの正規表現を使用します

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

まもなく、これは次の構文に変更される可能性があります。

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


BlackBerryの ホワイトリストは、WebWorks フレームワークの一部として提供され、config.xml で構成されます。

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

サンプル プロジェクトでは、ワイルド カード「*」を使用してすべての URL にアクセスできます。

于 2012-01-17T18:20:26.420 に答える