aboutsummaryrefslogtreecommitdiffstats
path: root/templates/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/index.html')
-rw-r--r--templates/index.html6
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);