From 4ed7dfb7ef69fa6d60eb57a8f0e8927d69c7bf9a Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Thu, 11 Apr 2019 02:45:42 +0300 Subject: prevent ctrl+w kvm session --- web/share/js/kvm/main.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'web/share/js/kvm') diff --git a/web/share/js/kvm/main.js b/web/share/js/kvm/main.js index 3019f980..97e3f62c 100644 --- a/web/share/js/kvm/main.js +++ b/web/share/js/kvm/main.js @@ -24,6 +24,12 @@ var wm; function main() { if (checkBrowser()) { + window.onbeforeunload = function(event) { + var text = "Are you sure you want to close Pi-KVM session?"; + event.returnValue = text; + return text; + }; + wm = new WindowManager(); tools.setOnClick($("show-about-button"), () => wm.showWindow($("about-window"))); -- cgit v1.2.3