Chrome扩展程序,内置iframe的模式

时间:2014-11-09 13:09:59

标签: iframe google-chrome-extension bootstrap-modal

我有一个扩展名,它使用Bootstrap.js。当用户单击扩展图标时,在我的内容脚本中进行一些计算,然后打开一个内部带有iframe的bootstrap模式窗口。 iframe始终指向一个适用于https的域,我希望用户在iframe中使用此站点。

现在它与http-sites完美配合,有时它也适用于https-sites,但通常我会收到错误,如

Refused to frame 'https://mysite.com' because it violates the following Content Security Policy directive: "default-src http://examplecom https://example.com"Refused to frame 'https://mysite.com' because it violates the following Content Security Policy directive: "frame-src 'none'

有没有解决办法让它发挥作用?

更新: 的 的manifest.json

   {
    "name": "MyExtension",
    "version": "1",
    "description": "My chrome extension",
    "browser_action": {
        "default_popup": "popup.html"
    },
    "content_scripts": [{
        "matches": ["http://*/*", "https://*/*"],
        "css": [
            "style.css"
        ],
        "js": [
            "bower_components/jquery/dist/jquery.js",
            "bower_components/bootstrap/dist/js/bootstrap.js",
            "content.js"
        ],
        "all_frames": true
    }],
    "permissions": [
        "activeTab",
        "https://127.0.0.1:8443/"
    ],
    "manifest_version": 2

    }

0 个答案:

没有答案