0
votes

I am trying to access my firebase database through my chrome extension. I am continuously getting this :-

enter image description here

My manifest file has this line for content_security_policy-

"content_security_policy": "script-src 'self' https://cdn.firebase.com https://*.firebaseio.com; object-src 'self'".

Edit-This is the error text:-

Refused to frame 'https://.firebaseapp.com/.... because it violates the following Content Security Policy directive: "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 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/ 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/ https://mail-payments.google.com/mail/payments/".

Refused to load the script 'https://...firebaseio.com/..... because it violates the following Content Security Policy directive: "script-src https://clients4.google.com/insights/consumersurveys/ 'self' 'unsafe-inline' 'unsafe-eval' https://mail.google.com/_/scs/mail-static/ https://hangouts.google.com/ https://talkgadget.google.com/ https://*.talkgadget.google.com/ https://www.googleapis.com/appsmarket/v2/installedApps/ https://www-gm-opensocial.googleusercontent.com/gadgets/js/ 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/ https://apis.google.com//scs/apps-static/_/js/ https://ssl.gstatic.com/inputtools/js/ https://ssl.gstatic.com/cloudsearch/static/o/js/ https://www.gstatic.com/feedback/js/ https://www.gstatic.com/common_sharing/static/client/js/ https://www.gstatic.com/og/_/js/".

I am trying to do remote injection to firebase database of this script. :-

var config = {
        apiKey: -----,
        authDomain: -----,
        databaseURL: ----,
        storageBucket: ----,
      };
      firebase.initializeApp(config);
      var dbRef=firebase.database().ref().child('text');
      $("#h1").on('keyup',function(){
         dbRef.set($("#h1").html());
      });

What should I do to tackle this error ?

1
Please include the actual error text, instead of a screenshot of an error message.Frank van Puffelen
@FrankvanPuffelen I am trying to write the contents of compose window of gmail to firebase database. Can you help me out ? Would be really helpful to get a lead in my app. Thanks :)Jitin Maherchandani

1 Answers

1
votes

Refused to load the script 'https://...firebaseio.com/..... because it violates the following Content Security Policy directiv

You should include the firebase.js script in your extension itself, instead of trying to load it from the public location.