【发布时间】:2016-08-17 08:55:11
【问题描述】:
我的 chrome 扩展的结构是这样的:
background.html
background.js
javascripts/angular...
javascripts/webRTC...
在 background.js 中,我使用的是 firebase 的 datachannel.js 库,它本质上创建了对 firebaseio.com 的远程调用
var socket = new window.Firebase('https://' +
(self.firebase || 'webrtc-experiment') + '.firebaseIO.com/' + channel);
chrome 将此错误返回到控制台:
Refused to load the script 'https://webrtc-experiment.firebaseio.com/.lp?start=t&ser=24080204&cb=23&v=5' because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:".
(anonymous function) @ firebase.js:168
这里是 manifest.json:
"manifest_version": 2,
"background": {
"page": "background.html"
},
"browser_action": {
"default_popup": "main.html",
"default_icon": "icon.png",
"default_title": "title"
},
"minimum_chrome_version": "37.0",
"name": "chromeextensionname",
"permissions": [
"<all_urls>",
【问题讨论】:
标签: javascript html google-chrome google-chrome-extension