1683
Views
5
Comments
Web page full screen
Question

Hi people i need a help,


I want to make a page go fullscreen automatically as soon as I enter.


Can someone help me?


Many thanks

2018-10-22 12-42-37
Manoj Ahirwar

Hi,

Following javascript can help you.

var elem = document.getElementById("CONTAINER_ID");
function openFullscreen() {
  if (elem.requestFullscreen) {
    elem.requestFullscreen();
  } else if (elem.mozRequestFullScreen) { /* Firefox */
    elem.mozRequestFullScreen();
  } else if (elem.webkitRequestFullscreen) { /* Chrome, Safari & Opera */
    elem.webkitRequestFullscreen();
  } else if (elem.msRequestFullscreen) { /* IE/Edge */
    elem.msRequestFullscreen();
  }
}


Thanks



2022-03-01 15-42-44
Thiago Mari
Champion

Manoj Ahirwar wrote:

Hi,

Following javascript can help you.

var elem = document.getElementById("CONTAINER_ID");
function openFullscreen() {
  if (elem.requestFullscreen) {
    elem.requestFullscreen();
  } else if (elem.mozRequestFullScreen) { /* Firefox */
    elem.mozRequestFullScreen();
  } else if (elem.webkitRequestFullscreen) { /* Chrome, Safari & Opera */
    elem.webkitRequestFullscreen();
  } else if (elem.msRequestFullscreen) { /* IE/Edge */
    elem.msRequestFullscreen();
  }
}


Thanks



Hi,


i want to entire page, not only one container


2017-03-03 12-48-17
Balasubramanian Prakasam

Hi Tiago,

Try to verify this link,

https://www.jqueryscript.net/demo/Easy-Elements-Fullscreen-Plugin-with-jQuery/examples/


with jquery plugin


Thanks,

Balu

2022-03-01 15-42-44
Thiago Mari
Champion

Balu wrote:

Hi Tiago,

Try to verify this link,

https://www.jqueryscript.net/demo/Easy-Elements-Fullscreen-Plugin-with-jQuery/examples/


with jquery plugin


Thanks,

BaluHi

Hi,


Not i looking for but thanks anyway =)

2025-01-07 17-06-54
Paulo Cação
Champion

Hi,

"You can't force a website to display in fullscreen mode". You need a user action/gesture to do that.

Imagine the security concerns if that were possible.

Malicious websites could "Hijack" a less computer literate person's desktop for all kinds of dubious business.

All of JS fullscreen api's will throw a error like this: "Failed to execute 'requestFullScreen' on 'Element': API can only be initiated by a user gesture." If you try to simply call it from your code.

Read this for more information.

I tested in my App OSMDb, and have the same result described above:


Regards.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.