From f3ac21839d907ecb1dd5af8284e4f90652cb99fd Mon Sep 17 00:00:00 2001 From: Mal Date: Sat, 24 May 2025 13:06:36 +0200 Subject: [PATCH] Tilorswift prevents unintentional window closings --- tilorswift/js/module.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tilorswift/js/module.js b/tilorswift/js/module.js index 577fcb9..05f34a3 100644 --- a/tilorswift/js/module.js +++ b/tilorswift/js/module.js @@ -6,6 +6,13 @@ import Setting from "../../js/Setting.js"; const imageLoader = new ImageLoader(); +window.addEventListener( + 'beforeunload', + (event) => { + event.preventDefault(); + } +); + for (const graphicSet of GraphicSet) { imageLoader.addImage('../' + Setting.TILESET_LOCATION + graphicSet.tileset);