From 69200c78548f5f3792f920decf3f763fdaf3f60f Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Mon, 28 Oct 2013 13:55:46 +0100 Subject: [PATCH] Prevent user from accidentally leaving the page --- js/websockets.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/websockets.js b/js/websockets.js index 6f4aa1b..c1d5995 100644 --- a/js/websockets.js +++ b/js/websockets.js @@ -667,6 +667,11 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', } } + // Prevent user from accidentally leaving the page + window.onbeforeunload = function(event) { + event.preventDefault(); + }; + }] );