Javascript Cordova CSP和GCM(由于在线方法在Cordova中使用eval而失败)

Javascript Cordova CSP和GCM(由于在线方法在Cordova中使用eval而失败),javascript,cordova,google-cloud-messaging,eval,Javascript,Cordova,Google Cloud Messaging,Eval,我不得不将CSP添加到我的应用程序中,但我遇到了麻烦 应用程序正在使用com.phonegap.plugins.PushPlugin插件,该插件工作正常,但在控制台中添加CSP后,它开始抛出此类错误: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy d

我不得不将CSP添加到我的应用程序中,但我遇到了麻烦

应用程序正在使用com.phonegap.plugins.PushPlugin插件,该插件工作正常,但在控制台中添加CSP后,它开始抛出此类错误:

Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source        of script in the following Content Security Policy directive: "script-src 'self'     https://*.domain.net http://*.domain.net".  cordova.js:1006
processMessage cordova.js:1006
androidExec.processMessages cordova.js:1076
pollOnce cordova.js:944
pollOnceFromOnlineEvent cordova.js:939

processMessage failed: Error: EvalError: Refused to evaluate a string as JavaScript because     'unsafe-eval' is not an allowed source of script in the following Content Security Policy      directive: "script-src 'self' https://*.domain.net http://*.domain.net".
cordova.js:1044
我已经研究过processMessage方法,但它在尝试使用的eval方法(eval(message.slice(1));)时失败,它违反了CSP

问题:是否可以使用CSP并注册GCM

如果有人这样做,请分享你的方法


提前感谢

您是否已尝试将
不安全评估
添加到您的保单中,如前所述?如果需要进行不安全评估,这是荒谬的。启用该功能将使应用程序面临注入带来的诸多安全风险,从远程位置加载任何内容(如广告)将近乎不负责任。