OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="/js-test-resources/js-test.js"></script> | 3 <script src="/js-test-resources/js-test.js"></script> |
4 </head> | 4 </head> |
5 <body> | 5 <body> |
6 <div id="description"></div> | 6 <div id="description"></div> |
7 <div id="console"></div> | 7 <div id="console"></div> |
8 <script type="text/javascript"> | 8 <script type="text/javascript"> |
9 parent.document.childWebSocket = new WebSocket("ws://127.0.0.1:8880/close-on-unl
oad"); | 9 parent.document.childWebSocket = new WebSocket("ws://127.0.0.1:8880/close-on-unl
oad"); |
10 | 10 |
11 parent.document.childWebSocket.onopen = function() | 11 parent.document.childWebSocket.onopen = function() |
12 { | 12 { |
13 // Send "socket1" to server, so that "socket1" will be broadcasted to | 13 // Send "socket1" to server, so that "socket1" will be broadcasted to |
14 // WebSockets connected to close-on-unload when this web socket is closed. | 14 // WebSockets connected to close-on-unload when this web socket is closed. |
15 parent.document.childWebSocket.send("socket1"); | 15 parent.document.childWebSocket.send("socket1"); |
16 }; | 16 }; |
17 parent.document.childWebSocket.onmessage = function(evt) | 17 parent.document.childWebSocket.onmessage = function(evt) |
18 { | 18 { |
19 // "socket1" is received by server, so ready to unload this document. | 19 // "socket1" is received by server, so ready to unload this document. |
20 parent.document.iframeReady(evt.data); | 20 parent.document.iframeReady(evt.data); |
21 }; | 21 }; |
22 </script> | 22 </script> |
23 </body> | 23 </body> |
24 </html> | 24 </html> |
OLD | NEW |