我正在尝试构建一个Chrome扩展程序,在我的
我尝试使用 resource在项目中设置firebase。我还尝试从 firebase-app.js和 firebase-database.js下载源代码,并使用导入。
但此文件具有来自以下的导入:
这违反了“内容安全策略”,我收到了这个错误。
我知道 外部代码限制。
在原生JS实现中有没有任何解决方法?
content.js
文件中使用firebase作为数据库,但是它不起作用。我正在使用v3
清单。但我无法导入firebase。我尝试使用 resource在项目中设置firebase。我还尝试从 firebase-app.js和 firebase-database.js下载源代码,并使用导入。
const firebase = chrome.extension.getURL('./firebase-app.js');
但此文件具有来自以下的导入:
https://www.gstatic.com/firebasejs/9.15.0/firebase-app.js
这违反了“内容安全策略”,我收到了这个错误。
Refused to load the script ‘https://www.gstatic.com/firebasejs/9.15.0/firebase-app.js’ because it violates the following Content Security Policy directive: “script-src ‘self’ ‘wasm-unsafe-eval’“. Note that ‘script-src-elem’ was not explicitly set, so ‘script-src’ is used as a fallback.
我知道 外部代码限制。
在原生JS实现中有没有任何解决方法?