R
R
retr02017-09-24 15:00:57
JavaScript
retr0, 2017-09-24 15:00:57

How to make Chrome extension requests available to Firebase?

I develop extensions for chrome working with Firebase. During the tests, everything works fine, requests for editing data are sent and processed correctly (By tests, I mean working with the page through the browser and file system). But after unpacking the extension into chrome itself, nothing works, the browser gives an error:

Refused to load the script 'https://www.gstatic.com/firebasejs/4.3.1/firebase.js' because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:".

"Permissions" in my manifest.json:
"permissions": [
    "https://console.firebase.google.com/*",
    "https://clipsync-xxxx.firebaseio.com/",
    "https://www.gstatic.com/firebasejs/4.3.1/firebase.js",
    "https://www.gstatic.com/",
    "https://firebaseio.com",
    "https://www.googleapis.com",
    "clipboardWrite",
    "clipboardRead"
  ]

Loading Firebase Script to HTML:
<script src="https://www.gstatic.com/firebasejs/4.3.1/firebase.js"></script>
<script type="text/javascript" src="firebase.js"></script>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vinni37, 2019-06-11
@Vinni37

In the manifest, add
"content_security_policy": "script-src 'self' 'unsafe-eval' https://www.gstatic.com/; object-src 'self'",

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question