Game1-layout #4

Merged
Frank merged 2 commits from Game1-layout into main 2026-01-06 19:21:58 +00:00
Showing only changes of commit 28ee969c29 - Show all commits

View File

@@ -60,6 +60,15 @@ document.addEventListener('DOMContentLoaded', async () => {
// Look for config injected by Twig in the page
const cfgEl = document.getElementById('mercure-config');
// Prevent/warn on page reload
window.addEventListener('beforeunload', (event) => {
// Standard way to trigger the browser's confirmation dialog
event.preventDefault();
// Included for compatibility with older browsers
event.returnValue = '';
});
if (!cfgEl) {
console.warn('[Mercure][game1] #mercure-config element not found on page');
return;