'socket' is not allowed for specified package type (theme, app, etc.)

丶灬走出姿态 提交于 2019-12-01 05:33:59

问题


Chrome API for sockets is not working now for me.

I've got following manifest:

{
 "name": "My name",
 "version": "0.1",
 "manifest_version": 2,
 "background": {
  "page": "background.html"
  },
 "browser_action": {
  "default_icon": "ico16.png",
  "default_title": "My extension",
  "default_popup": "popup.html"
  },
  "description": "bla bla bla",
  "minimum_chrome_version": "23",
 "icons": {
    "ico128": "ico128.png",
    "ico16": "ico16.png",
    "icon_logo": "icon_logo.png"
  },
 "options_page": "options.html",
 "permissions": ["experimental",
                 {"socket": [
                     "udp-send-to"
                   ]},
                  "notifications",
                  "background"]

}

but following warning it's been displayed when loading the extension:

'socket' is not allowed for specified package type (theme, app, etc.).

I've tested with Version 23.0.1246.0 canary and 23.0.1246.0 dev-m


回答1:


This is expected behavior, the socket API is only available to packaged apps, and based on the manifest you're working on an extension.



来源:https://stackoverflow.com/questions/12161964/socket-is-not-allowed-for-specified-package-type-theme-app-etc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!