Support for FireFox websockets. They use window.MozWebSocket rather than window.WebSocket.

This commit is contained in:
Veebs 2011-10-13 10:17:49 +11:00
parent 33f548a8ae
commit f8b96fe6b8

View File

@ -39,6 +39,9 @@ public class WebSocketServerIndexPage {
"<body>" + NEWLINE +
"<script type=\"text/javascript\">" + NEWLINE +
"var socket;" + NEWLINE +
"if (!window.WebSocket) {" + NEWLINE +
" window.WebSocket = window.MozWebSocket;" + NEWLINE +
"}" + NEWLINE +
"if (window.WebSocket) {" + NEWLINE +
" socket = new WebSocket(\"" + webSocketLocation + "\");" + NEWLINE +
" socket.onmessage = function(event) { var ta = document.getElementById('responseText'); ta.value = ta.value + '\\n' + event.data };" + NEWLINE +