nav: fullscreen on first user interaction with screen (browser policy fix)
This commit is contained in:
+10
-1
@@ -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();
|
connect();
|
||||||
setTimeout(() => { try { document.documentElement.requestFullscreen(); } catch(e){} }, 800);
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -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();
|
connectRfb();
|
||||||
setTimeout(() => { try { document.documentElement.requestFullscreen(); } catch(e){} }, 800);
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user