无法从 android 设备进行 ajax 调用,因为未安装 cordova-plugin-whitelist 但我无法安装它?

Can't do ajax calls from android device because cordova-plugin-whitelist is not installed but i can't install it?

我遇到了这个相当奇怪的问题我使用 cordova 为 android 构建了一个应用程序并让 ajax 调用它并且它们工作但由于某种原因在我的电脑上出现 BSoD当我再次将应用程序发布到我的 android phone.

时,所有 ajax 调用都停止工作

我的第一个想法是 Visual Studio 没有添加 cordova-plugin-whitelist 所以我做了一个新项目并尝试添加插件来测试这是否是问题所在,但是现在当我添加插件我的构建失败,输出 window 显示此 Output on pastebin(将于 2015-09-07 到期)

如果未安装 cordova-plugin-whitelist,ajax 调用可在 Android 模拟器和 Ripple 上运行

Javascript:

(function () {
"use strict";

document.addEventListener( 'deviceready', onDeviceReady.bind( this ), false );

function onDeviceReady() {
    // Handle the Cordova pause and resume events
    document.addEventListener( 'pause', onPause.bind( this ), false );
    document.addEventListener( 'resume', onResume.bind( this ), false );
    $.ajax({
        url: 'https://www.path.com/Controller/Action',
        async: false,
        type: "GET",
        dataType: "json",
        beforeSend: function () { $.mobile.loading('show'); },
        success: function (DataToFillSelect) {
            $.each(DataToFillSelect, function (val, item) {
                $('#Select').append(
                    $('<option></option>').val(item.Value).html(item.Text)
                );
            });
        },
        error: function () {

        },
        complete: function () { $.mobile.loading('hide'); },
    })
    // TODO: Cordova has been loaded. Perform any initialization that requires Cordova here.
};

function onPause() {
    // TODO: This application has been suspended. Save application state here.
};

function onResume() {
    // TODO: This application has been reactivated. Restore application state here.
};
} )();

它只是添加了 ajax 调用 onDeviceReady 函数的空白模板

如果您需要我提供更多信息,尽管问我,我会在这里一整天:) 感谢您花时间帮我解决我的这个问题!

从 config.xml 和项目中删除了 cordova-plugin-whitelist 并添加了包含

的元标记
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src: 'self' 'unsafe-inline' 'unsafe-eval'">

现在它再次起作用了,我不知道为什么如果有人能向我解释它,我会很高兴,当然我仍然很高兴它起作用但你知道它为什么起作用会更好:)

谢谢大家的帮助!