How do I make my NW.js application *start* in fullscreen?

Viewed 175

I know how to enter fullscreen once it's already loaded in a window. This causes an ugly effect where, when I click its icon, briefly flashes a windowed window which immediately goes fullscreen. I hate that effect.

How do I make it actually start, right away, in fullscreen, without ever being in windowed mode even for a split second?

3 Answers

If you want more info go to https://www.w3schools.com/howto/howto_js_fullscreen.asp#:~:text=To%20open%20an%20element%20in%20fullscreen%2C%20we%20use,fullscreen%20mode%20%28a%20video%20in%20this%20example%29%3A%20%2A%2F this would work if youre making an website

function openFullscreen() {
  if (elem.requestFullscreen) {
    elem.requestFullscreen();
  } else if (elem.webkitRequestFullscreen) { /* Safari */
    elem.webkitRequestFullscreen();
  } else if (elem.msRequestFullscreen) { /* IE11 */
    elem.msRequestFullscreen();
  }
}

/* Close fullscreen */
function closeFullscreen() {
  if (document.exitFullscreen) {
    document.exitFullscreen();
  } else if (document.webkitExitFullscreen) { /* Safari */
    document.webkitExitFullscreen();
  } else if (document.msExitFullscreen) { /* IE11 */
    document.msExitFullscreen();
  }
}

I'm not a JS pro but I code in python and i think if you made a function like this one it would work idk though


function onstart(){
 if (boolean == true): 
// Fullscreen code 
}
// Your code here 
onstart()
Related