Chrome Extension Socket io node js

前端 未结 2 799
名媛妹妹
名媛妹妹 2021-02-03 11:11

I need to create a chrome extension which shows a notification when we get a message from socket io node js server.

How to include socket io in chrome extension? I am n

2条回答
  •  后悔当初
    2021-02-03 11:41

    Since you only need the socket.io-client, this is what you should be doing:

    "background": {
      "scripts": [
        "socket.io.js",
        "background.js"
      ]
    },
    

    Download and add the socket.io.js file from here: https://raw.githubusercontent.com/Automattic/socket.io-client/1.3.5/socket.io.js

提交回复
热议问题