문제

I've read somewhere that the trunk version of Firefox already had a WebSocket implementation. Nevertheless, I've just tried the 3.7a4pre without success. It still gives me the old "WebSocket is not defined" error message. Am I confused with WebWorkers?

Using a flash-based WebSocket implementation is not an option. Please advice.

도움이 되었습니까?

해결책

According to bug 472529 a patch has not yet been applied to trunk.

WebSocket (both the API and the wire protocol) are still in draft, so we're a way off yet.

Using a flash-based WebSocket implementation is not an option.

I'm afraid a fallback (Flash, Java, XMLHttpRequest long-polling etc.) is your only option in Firefox for now. The only browser that currently has native WebSocket is Chrome.

다른 팁

WebSockets has been just landed on Firefox trunk.

WebSockets disabled in Opera and Firefox 4: http://hacks.mozilla.org/2010/12/websockets-disabled-in-firefox-4/

They are called MozWebSockets on Firefox since v4

Check out the Mozilla Websocket Reference

Since Firefox supports WebSockets not strictly to official standards it had prefix "Moz", so you have to check if WebSocket is existing object, if yes use it, if no check MozWebSocket, if yes, then use it. Since Firefox 11, they do support WebSockets without prefix, so it is the same as in Chrome now.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top