window.fullScreen=true is not working

17,876

Solution 1

This is unadvisable as it results in unexpected browser behviour for the user. For this reason, many browsers no longer let unprivileged scripts modify this setting.

For example, from Mozilla Developer Center

With chrome privileges, the property is read-write, otherwise it is read-only.

See https://developer.mozilla.org/En/DOM/Window.fullScreen

Solution 2

I'm pretty sure that most browsers block this nowadays as it's annoying.

Solution 3

Chrome 15, Firefox 10, and Safari 5.1 now provide APIs to programmatically trigger fullscreen mode.

See this hacks.mozilla.org blog post for details.

Share:
17,876
Admin
Author by

Admin

Updated on June 28, 2022

Comments

  • Admin
    Admin almost 2 years

    I would like to open my html page in fullscreen mode. I tried to execute this javascript in body's onload event handler.

    window.fullScreen = true;
    

    But unfortunately that doesn't seem to be working. Is there any other way with which we can achieve the same.