Blackberry 10 Whitelisting

不羁的心 提交于 2020-01-04 13:12:08

问题


I'm using Phonegap 2.8.0 for a Blackberry 10 App.

I can't whitelist https URLs.

Other URLs are working for whitelisting.

<access subdomains="true" uri="https://abcdefg.com" />
<access subdomains="true" uri="http://abcdefg.com" />

The http is working, but the https always shows the following message:

Javascript Alert

Access to "https://abcdefg.com not allowed

Please help :-)


回答1:


For everyone else, there is a dirty solution to make it work.

In the www/config.xml add this:

<feature id="blackberry.app" >
    <param name="websecurity" value="disable" />
</feature>

Not pretty, but at least you can test it with this setting




回答2:


Thanks to @sunny7777777 for pointing to the workaround. For anyone else using Cordova 3.1 or higher, you can disable websecurity using this command:

<preference name="websecurity" value="disable" gap:platform="blackberry10" />

@candlejack added in the comments: Set to disable to override web security settings, allowing access to remote content from unknown sources. This preference is intended as a development convenience only, so remove it before packaging your app for distribution. For the released app, all URIs should be known and whitelisted using the element, described in the Domain Whitelist Guide.

I am now convinced that this workaround should only be used during development and not in production. This is true for all platforms, not just BB. So be careful to remove this before publishing your app!



来源:https://stackoverflow.com/questions/17419494/blackberry-10-whitelisting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!