I'm trying to implement jQuery in my Chrome Extension in order to include the firebase.js in my background.js (which seems already weird), however chrome refuses to execute code from inside the jquery.js.
background.js
$.getScript('firebase.js', function()
{
// code depending on firebase.js, jquery is just needed here to include firebase.js
});
popup.html
<html>
<head>
<script src="jquery-3.0.0.min.js"></script>
<script src="firebase.js"></script>
<script src="popup.js"></script>
<script src="background.js"></script>
</head>
<body>
//stuff happens
</body>
</html>
manifest.json
"content_scripts":[
{
"js":["jquery-3.0.0.min.js"],
"all_frames":true
}
],
"background": {
"scripts": ["background.js","jquery-3.0.0.min.js"],
"persistent": true
},
So for me it looks like it is included properly, however I am getting this, which is very weird, since it is inside the jquery library:
jquery-3.0.0.min.js:2 Refused to execute inline script because it violates the following Content Security Policy
Isn't there another method on how to include Firebase.js in the background.js? It makes no sense that it doesn't work there, it is included in my popup.html.
Aucun commentaire:
Enregistrer un commentaire