4

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

Mihai Parparita
  • 4,236
  • 1
  • 23
  • 30
Gonzalo
  • 41
  • 3

2 Answers2

4

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

Mihai Parparita
  • 4,236
  • 1
  • 23
  • 30
0

If you will communicate this extension with a NodeJs application, you can use Socket.iO for this. Check how: https://www.thirdrocktechkno.com/blog/node-js-socket-io-chrome-extension-integration/

Lucas
  • 157
  • 1
  • 12