Support for FireFox websockets. They use window.MozWebSocket rather than window.WebSocket.
This commit is contained in:
parent
33f548a8ae
commit
f8b96fe6b8
@ -39,6 +39,9 @@ public class WebSocketServerIndexPage {
|
|||||||
"<body>" + NEWLINE +
|
"<body>" + NEWLINE +
|
||||||
"<script type=\"text/javascript\">" + NEWLINE +
|
"<script type=\"text/javascript\">" + NEWLINE +
|
||||||
"var socket;" + NEWLINE +
|
"var socket;" + NEWLINE +
|
||||||
|
"if (!window.WebSocket) {" + NEWLINE +
|
||||||
|
" window.WebSocket = window.MozWebSocket;" + NEWLINE +
|
||||||
|
"}" + NEWLINE +
|
||||||
"if (window.WebSocket) {" + NEWLINE +
|
"if (window.WebSocket) {" + NEWLINE +
|
||||||
" socket = new WebSocket(\"" + webSocketLocation + "\");" + NEWLINE +
|
" socket = new WebSocket(\"" + webSocketLocation + "\");" + NEWLINE +
|
||||||
" socket.onmessage = function(event) { var ta = document.getElementById('responseText'); ta.value = ta.value + '\\n' + event.data };" + NEWLINE +
|
" socket.onmessage = function(event) { var ta = document.getElementById('responseText'); ta.value = ta.value + '\\n' + event.data };" + NEWLINE +
|
||||||
|
Loading…
Reference in New Issue
Block a user