Comments (5)
唔……有毒的命名(
from node-cq-websocket.
我還真沒有在前端的環境測試過, 不過這個包並沒有依賴任何OS的東西, 理論上可以在 JS 環境中使用
依賴的 websocket 包也說明他們支援各大瀏覽器 (參考連結)
Uncaught TypeError: $WebsocketClient is not a constructor
這個原因極有可能是因為 $WebsocketClient
裡面是個 undefined
想請問你如何在 js 中使用這個包的? 是否使用 webpack ?
from node-cq-websocket.
deprecate WebSocket-Node and use ws should solve this problem.
from node-cq-websocket.
In docs of ws, it says
Note: This module does not work in the browser. The client in the docs is a reference to a back end with the role of a client in the WebSocket communication. Browser clients must use the native WebSocket object.
However, WebSocket-Node has already supported to run on browsers. See here.
All current browsers are fully supported.
Firefox 7-9 (Old) (Protocol Version 8)
Firefox 10+ (Protocol Version 13)
Chrome 14,15 (Old) (Protocol Version 8)
Chrome 16+ (Protocol Version 13)
Internet Explorer 10+ (Protocol Version 13)
Safari 6+ (Protocol Version 13)
I think WebSocket-Node is still the right choice for this SDK.
In order to support running on browsers, in his case, Webpack is required to bundle those dependencies.
(Or just use native Websocket instead!)
from node-cq-websocket.
這帖之後就在 #9 追蹤。
from node-cq-websocket.
Related Issues (20)
- A list of deprecated APIs for v2 HOT 2
- Refactor the document
- Add the auto-build of CQWebSocket browser version into CI pipeline HOT 1
- HelpWanted HOT 3
- Inconsistent parameters among message events HOT 1
- Support meta events
- Wrong version used for browser bundle, the previous version is used HOT 4
- Support Vue.js as a Vue plugin HOT 2
- WS connect problem HOT 1
- 怎么使用 HOT 6
- ES6 import failed HOT 4
- The test for manual re-connection failed frequently.
- Memory leak in EventBus HOT 2
- Development flows
- websocket can't be reconnected sometimes HOT 6
- d.ts文件声明中少了元事件的类型
- 想问问如何付费? HOT 2
- demo code not work HOT 2
- 如何发送群组消息?
- 缺失notice.group_ban事件 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-cq-websocket.