nav: fullscreen on first user interaction with screen (browser policy fix)

This commit is contained in:
2026-07-20 19:16:02 +00:00
parent e079723922
commit f00d51cd76
2 changed files with 20 additions and 2 deletions
+10 -1
View File
@@ -258,8 +258,17 @@ cat > /opt/portal/index.html <<HTML
});
})();
// Enter fullscreen on first user interaction with the screen
(function(){
function tryFs() {
if (!document.fullscreenElement) {
document.documentElement.requestFullscreen().catch(() => {});
}
document.getElementById('screen').removeEventListener('pointerdown', tryFs);
}
document.getElementById('screen').addEventListener('pointerdown', tryFs, {once: true});
})();
connect();
setTimeout(() => { try { document.documentElement.requestFullscreen(); } catch(e){} }, 800);
</script>
</body>
</html>
+10 -1
View File
@@ -289,8 +289,17 @@ cat > /opt/portal/index.html <<'HTML'
});
})();
// Enter fullscreen on first user interaction with the screen
(function(){
function tryFs() {
if (!document.fullscreenElement) {
document.documentElement.requestFullscreen().catch(() => {});
}
document.getElementById('screen').removeEventListener('pointerdown', tryFs);
}
document.getElementById('screen').addEventListener('pointerdown', tryFs, {once: true});
})();
connectRfb();
setTimeout(() => { try { document.documentElement.requestFullscreen(); } catch(e){} }, 800);
</script>
</body>
</html>