I'm trying to make a page go full screen as soon as the user starts scrolling on mobile.
I'm aware of the fact that as stated in this mdn link , for usability reasons, the browser will only allow a page to occupy the full-screen in response to a user gesture, therefore, I need to place my request to full-screen within a fast event handler so I did the following:
function goFullScreen() {
if (document.fullscreenEnabled) {
requestFullscreen(document.documentElement);
}
document.removeEventListener('touchend', goFullScreen);
}
document.addEventListener('touchend', goFullScreen);
However, when I scroll the page I get this result on chrome:
I must be missing something here because when I click, without dragging the pointer, it does work.
PS: full version of the script can be found in this [fiddle] .. (https://jsfiddle.net/OsvaldoM/0kpm1s93/13/) also , this is just an experiment so please don't mind the terrible effects it would have to UX