5
Apps usually asks for permission to use Smartphone features like microphone, camera... I wonder if it is possible to do the same on a page so that the Fullscreen mode is activated automatically whenever the user opens the page, since it gave permission for the page.
The code below puts the entire document in Fullscreen when it is triggered by some event click by exmeplo:
if (!document.fullscreenElement &&
!document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement ) {
if (document.documentElement.requestFullscreen) {
document.documentElement.requestFullscreen();
} else if (document.documentElement.msRequestFullscreen) {
document.documentElement.msRequestFullscreen();
} else if (document.documentElement.mozRequestFullScreen) {
document.documentElement.mozRequestFullScreen();
} else if (document.documentElement.webkitRequestFullscreen) {
document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
}
Is there any way to request the user’s permission so that my site can use such function automatically, without relying on a trigger given by the same?
Are you familiar with the concept of Progressive Web Apps? I think that’s what you want: https://brasil.uxdesign.cc/o-que-s%C3%A3o-Progressive-web-apps-86e1b5306051#. 8rt2qxssj
– Daniel
@cav_dan I know yes, I will even do tutorials on my site teaching users about, but it’s not necessarily what I want to do
– Leo Letto