【发布时间】:2019-01-28 17:54:43
【问题描述】:
我在我的 chrome 扩展项目中包含一个 Jabra javascript 库。
https://github.com/gnaudio/jabra-browser-integration/blob/master/README.md
该库与需要安装的 chrome 扩展程序以及安装在 Windows pc 上的客户端进行通信。
如果我运行任何 github 工具;例如https://gnaudio.github.io/jabra-browser-integration/release/test/ 我可以看到事件。
如果我创建一个小应用程序并将其托管在 Apache 上,我可以毫无问题地访问 API 并查看事件。
当我在我的 chrome 扩展程序中运行应用程序时,它看不到 chrome 扩展程序并建议我安装它。
https://chrome.google.com/webstore/detail/jabra-browser-integration/okpeabepajdgiepelmhkfhkjlhhmofma
在我的 chrome 扩展应用程序中,我尝试包含来自我的网络主机的 javascript api 库:<script src="https://example.com/jabra_research/jabra.browser.integration-2.0.js"></script>
另请参阅我的清单文件:
{
"name": "Jabra",
"manifest_version": 2,
"version": "0.3.9.2",
"author": "Joe Bloggs",
"description": "Get Jabra Headset Info",
"background": {
"page": "background.html",
"persistent": true
},
"browser_action": {
"default_icon": {
"19": "ext_icons/icon_19.png",
"38": "ext_icons/icon_38.png"
}
},
"icons": {
"16": "ext_icons/icon_16.png",
"48": "ext_icons/icon_48.png",
"128": "ext_icons/icon_128.png"
},
"options_page": "config.html",
"permissions": [
"activeTab",
"alarms",
"background",
"tabs",
"system.cpu",
"contextMenus",
"unlimitedStorage",
"storage",
"notifications",
"cookies",
"*://*/*",
"<all_urls>",
"http://*/",
"https://*/",
"management"
],
"content_security_policy": "script-src 'self' https://example.com/jabra_research/jabra.browser.integration-2.0.js; object-src 'self' https://example.com/jabra_research/jabra.browser.integration-2.0.js",
"web_accessible_resources": [
"*"
]
}
我的 background.html 文件包含 API 文件。它几乎就像 background.html 运行时一样,它不会被视为与普通 chrome 浏览器选项卡一样。
有什么可以推荐的吗?
我注意到 API 的第 1080 行“仅在托管在 https 下有效”。我怀疑这与它有关。
韩国, 艾登
【问题讨论】:
-
您好,您解决了吗?我遇到了同样的问题。
-
嗨,Durko,不,很遗憾没有。我现在把它停了,看看是否会有任何更新来促进这一点。不要以为你自己有什么吸引力?
标签: javascript google-chrome-extension