commit 8e4f54799a6486f0cad7f0004799b99049eaf6f2
parent 3bf1d052a7c6028c5af0bd762c1e377f15e336bd
Author: Hunter
Date:   Tue, 21 Oct 2025 17:57:35 -0400

warn before leaving page if images are present

Diffstat:
Mscript.js | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/script.js b/script.js @@ -702,3 +702,12 @@ document.addEventListener('keyup', (e) => { // Load theme on page load loadThemeFromLocalStorage(); + +// Warn before leaving page if images are present +window.addEventListener('beforeunload', (e) => { + if (images.length > 0) { + e.preventDefault(); + e.returnValue = ''; + return ''; + } +});