繁体   English   中英

chrome扩展名权限不起作用

[英]chrome extension permissions not working

我的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>",

用manifest.json中的content-security-policy解决

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

引用:

https://developer.chrome.com/extensions/contentSecurityPolicy

如何在Chrome Extension Manifest.json中设置内容安全策略以使Firebase正常工作

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM