summaryrefslogtreecommitdiff
path: root/web/share/js/kvm/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/share/js/kvm/main.js')
-rw-r--r--web/share/js/kvm/main.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/web/share/js/kvm/main.js b/web/share/js/kvm/main.js
index 85fcb5db..3717f71d 100644
--- a/web/share/js/kvm/main.js
+++ b/web/share/js/kvm/main.js
@@ -32,11 +32,17 @@ import {Session} from "./session.js";
export function main() {
if (checkBrowser()) {
- window.onbeforeunload = function(event) {
- let text = "Are you sure you want to close PiKVM session?";
- event.returnValue = text;
- return text;
- };
+ tools.storage.bindSimpleSwitch($("page-close-ask-switch"), "page.close.ask", true, function(value) {
+ if (value) {
+ window.onbeforeunload = function(event) {
+ let text = "Are you sure you want to close PiKVM session?";
+ event.returnValue = text;
+ return text;
+ };
+ } else {
+ window.onbeforeunload = null;
+ }
+ });
initWindowManager();