0

I was working on a chromecast app, and I wanted to incorporate it into a chrome extension. I'm also using knockout.js in order to help with some of the UI. I have two pages, one is unsandboxed (http://jsfiddle.net/AuJaX/3/), and the other is sandboxed (http://jsfiddle.net/V2dJc/1/). None of the console.log's ever get called. My manifest is below:

{
  "manifest_version": 2,
  "name": "__MSG_app_title__",
  "description": "__MSG_app_description__",
  "version": "0.1",
  "content_scripts": [
    {
  "matches": ["<all_urls>"],
      "js": ["js/content/content.js"]
    }
  ],
  "background": {
    "scripts": ["js/back/background.js"],
    "persistent": false
  },
  "permissions": [
    "tabs",
    "contextMenus"
  ],
  "page_action": {
    "default_title": "__MSG_app_title__",
    "default_icon": {
      "19": "images/icon-19.png"
    }
  },
  "sandbox": {
    "pages": ["sandboxed.html"]
  },
  "icons": { "48": "images/icon.png" },
  "default_locale": "en"
}

Is there anything that I'm doing wrong, or is this something that's not supported (yet??)?

4

1 回答 1

3

您是否将尝试使用扩展程序的域列入白名单?目前要将 Cast API 注入页面,您需要两件事:

<html data-cast-api-enabled="true">

并且您需要按照本页底部的步骤进行操作(在扩展程序中加入白名单,与 Google Cast 设备白名单不同):

https://developers.google.com/cast/whitelisting#whitelist-chrome

也就是说,我怀疑这会奏效。这些说明用于将 Cast API 注入到常规网页中。但是,如果我没记错的话,您希望将 API 注入您的 Chrome 扩展页面。我不知道它是否会在那里提供,因为我认为不允许两个不同的扩展进行交互。

于 2013-08-11T02:12:34.693 回答