【问题标题】:Whitelisting error on Phonegap/CordovaPhonegap/Cordova 上的白名单错误
【发布时间】:2015-10-14 20:46:13
【问题描述】:

我在使用 phonegap/cordova 时遇到了一个奇怪的白名单错误

 var app = angular.module('myApp',
                     ['ngResource', 'ngRoute', 'ngStorage',
                      'ui.bootstrap', 'ui.sortable', 'ui.utils', 'ui.calendar','ui.select2',
                      'com.2fdevs.videogular',
                      'googlechart',
                      'monospaced.elastic',
                      'ngImgCrop',
                      'anguFixedHeaderTable',
                      'toggle-switch',
                      'ngFileUpload',
                      'textAngular'],
                      function ($compileProvider) {
                        $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|webcal|mailto):/);
                      }
 );

当我有这个 aHrefSanitizationWhitelist 时,我无法访问类似的链接 链接名称 像这样的链接工作正常 链接名称

如果我注释掉

    function ($compileProvider) {
                        $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|webcal|mailto):/);

链接工作正常。

问题是应用程序使用 webcal,当我注释掉这些行时,它会破坏网络日历功能。

在我的 config.xml 文件中,我有以下内容:

   <access origin="*" />

任何想法,在此先感谢。

【问题讨论】:

标签: cordova phonegap-build whitelist


【解决方案1】:

将以下内容添加到您的 config.xml 文件中

<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />

【讨论】:

  • 您可能还需要 CSP。
猜你喜欢
  • 1970-01-01
  • 2013-01-03
  • 2015-03-03
  • 1970-01-01
  • 2017-05-02
  • 2015-06-01
  • 1970-01-01
  • 2012-06-03
  • 1970-01-01
相关资源
最近更新 更多