我正在尝试通过Chrome扩展程序访问我的firebase数据库。 我不断得到这个: -
我的清单文件包含content_security_policy -
这一行"content_security_policy": "script-src 'self' https://cdn.firebase.com https://*.firebaseio.com; object-src 'self'".
编辑 - 这是错误文字: -
拒绝框架' https:// .firebaseapp.com / .... 因为它违反了以下内容安全政策指令:"" frame-src https://clients4.google.com/insights/consumersurveys/ https://calendar.google.com/accounts/' self' https://accounts.google.com/ https://apis.google.com/u/ https://apis.google.com/_/streamwidgets/ https://clients6.google.com/static/ https://content.googleapis.com/static/ https://mail-attachment.googleusercontent.com/ https://www.google.com/calendar/ https://calendar.google.com/calendar/ https://docs.google.com/ https://drive.google.com https:// .googleusercontent.com / docs / securesc / https://feedback.googleusercontent.com/resources/ https://www.google.com/tools/feedback/ https://support.google.com/inapp/ https:// .googleusercontent.com / gadgets / ifr {{3 }} https://hangouts.google.com/ https:// .talkgadget.google.com / https://talkgadget.google.com/ https://www-gm-opensocial.googleusercontent.com/gadgets/ https://plus.google.com/ https://wallet.google.com/gmail/ https://www.youtube.com/embed/ {{3 }} https://clients5.google.com/pagead/drt/dn/ https://clients5.google.com/ads/measurement/jn/ https://www.gstatic.com/mail/ww/ https://www.gstatic.com/mail/intl/ https://clients5.google.com/webstore/wall/ https://ci3.googleusercontent.com/ https://apis.google.com/additnow/ https://www.gstatic.com/mail/promo/"。
拒绝加载脚本' https://notifications.google.com/ .....因为它违反了以下内容安全策略指令:" script-src https://mail-payments.google.com/mail/payments/' self&# 39; '不安全直插' '不安全-EVAL' https://...firebaseio.com/ https://clients4.google.com/insights/consumersurveys/ https://mail.google.com/_/scs/mail-static/ https://*.talkgadget.google.com/ https://hangouts.google.com/ https://talkgadget.google.com/ https://www.googleapis.com/appsmarket/v2/installedApps/ https://www-gm-opensocial.googleusercontent.com/gadgets/js/ {{3 }} https://docs.google.com/static/doclist/client/js/ https://www.google.com/tools/feedback/ https://s.ytimg.com/yts/jsbin/ https://www.youtube.com/iframe_api https://ssl.google-analytics.com/ https://apis.google.com//scs/abc-static/ https://apis.google.com/js/ https://clients1.google.com/complete/ { {3}} https://apis.google.com/ /scs/apps-static/_/js/ https://ssl.gstatic.com/inputtools/js/"。
我正在尝试远程注入此脚本的firebase数据库。 : -
var config = {
apiKey: -----,
authDomain: -----,
databaseURL: ----,
storageBucket: ----,
};
firebase.initializeApp(config);
var dbRef=firebase.database().ref().child('text');
$("#h1").on('keyup',function(){
dbRef.set($("#h1").html());
});
我该怎么做才能解决这个错误?
答案 0 :(得分:1)
拒绝加载脚本“https://...firebaseio.com/ .....因为它违反了以下内容安全政策指令
您应该在扩展程序中包含firebase.js
脚本,而不是尝试从公共位置加载它。