diff options
| author | 2018-05-26 12:54:49 +0200 | |
|---|---|---|
| committer | 2018-05-26 12:54:49 +0200 | |
| commit | ea2141dc6fd7284e6f9fa04ee638460286e3b09c (patch) | |
| tree | 218d332be80bd2f4e177b0d9e4725dd27dec2034 /templates/index.html | |
| parent | lint (diff) | |
simplify threads and use local thread variables to manage user websocket connections
Diffstat (limited to 'templates/index.html')
| -rw-r--r-- | templates/index.html | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/templates/index.html b/templates/index.html index ef53d74..9fd6350 100644 --- a/templates/index.html +++ b/templates/index.html @@ -91,8 +91,10 @@ function generate_id(){ return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); } - - +window.onbeforeunload = function() { + sendMessage("disconnect") + websocket.close() +}; window.addEventListener("load", init, false); |