Make google-chrome browser full screen on page load

Please think about the answer to this question here, even if you marked it as a duplicate , because for some reason I just can not get it to work with other solutions, and although I tried to ask for help, nobody answered ...

I really want to $(document).ready(function(){browser goes fullscreen}), but, unfortunately, it does not work, and I am desperately trying to find a solution online, because nothing works! I have a js file well pasted into my main php file (console.log works), but it just won’t load full screen mode regardless of lines of code ...

If you can provide a solution for working in all browsers and with activated keys , I would really be grateful. Otherwise, I will downplay myself using Google's chrome response. Thank you very much.

EDIT1:

I tried this

// mozilla proposal
element.requestFullScreen();
document.cancelFullScreen(); 

// Webkit (works in Safari and Chrome Canary)
element.webkitRequestFullScreen(); 
document.webkitCancelFullScreen(); 

// Firefox (works in nightly)
element.mozRequestFullScreen();
document.mozCancelFullScreen(); 

// W3C Proposal
element.requestFullscreen();
document.exitFullscreen();

The following user can only interact with the user:

addEventListener("click", function() {
    var
          el = document.documentElement
        , rfs =
               el.requestFullScreen
            || el.webkitRequestFullScreen
            || el.mozRequestFullScreen
    ;
    rfs.call(el);
});

among others I cannot find now, and basically I combined them with $(document).ready(function(){---});, but nothing happened.

+4
source share
1 answer

Short answer: you cannot.

I tested using this code .

Firefox - , , , , Firefox .

Request for full-screen was denied because Element.mozRequestFullScreen() was not called from inside a short running user-generated event handler. 

:

, , " ", , , "click"

, . - ( - ), .

(navigator.userAgent):

  • Chrome 31: "5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36"
  • Firefox 25: "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0"
  • IE 11: "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3; rv:11.0) like Gecko"
+5

All Articles