mirror of
https://github.com/thelounge/thelounge.git
synced 2024-06-18 13:35:10 +02:00
Merge pull request #3604 from thelounge/xpaw/beforeunload
Fix beforeunload not working
This commit is contained in:
commit
cd6821a196
|
@ -26,9 +26,9 @@ socket.once("configuration", function(data) {
|
|||
}
|
||||
|
||||
if (document.body.classList.contains("public")) {
|
||||
window.addEventListener(
|
||||
"beforeunload",
|
||||
() => "Are you sure you want to navigate away from this page?"
|
||||
);
|
||||
window.addEventListener("beforeunload", (e) => {
|
||||
e.preventDefault();
|
||||
e.returnValue = "Are you sure you want to navigate away from this page?";
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue