Full Screen - JS

Asked

Viewed 21 times

0

I need help dear friends, below I have a code to make the page stay on FULL SCREEN, more need to click the button every time I enter the page to stay on FULL SCREEN.

I would like that every time you enter the page the script already ran automatically and entered FULL SCREEN alone.

Below is my HTML code:

<body onload="scree()">
<div>
    <button id="request">Request</button>
</div>

Follows below JS code:

<script>
function scree() {

    $('#request').click(function() {
        screenfull.request($('#container')[0]).then(function() {
            console.log('Browser entered fullscreen mode')
        })
    });
    screenfull.on('change', fullscreenchange);
    fullscreenchange();
}</script>

I’m using the library screenfull.js, could help me?

  • Dear John, this is unfeasible, first because if it were possible I really as a user would refuse to browse several websites, that would use it indiscriminately, many lay users would get lost without knowing what to do or angry, the API itself was created to be so, to require the user to interact, https://answall.com/a/306227/3635

  • If there was such a possibility of entering a full-screen site without prior authorization, pages would appear quickly by cloning the browsers interface.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.