The javascript code that I’m using, to fullscreen my web app,
JavaScript
x
9
1
var beginFullScreen = () => {
2
const doc = window.document;
3
const docEl = doc.documentElement;
4
let requestFullScreen = docEl.requestFullscreen || docEl.mozRequestFullScreen || docEl.webkitRequestFullScreen || docEl.msRequestFullscreen;
5
if(!doc.fullscreenElement && !doc.mozFullScreenElement && !doc.webkitFullscreenElement && !doc.msFullscreenElement) {
6
requestFullScreen.call(docEl);
7
}
8
}
9
Usually, I’m getting a black background on the top-notch area on every page I’ve tried to implement this through console, but on my webapp, I’m getting a white background.
I’ve tried adding
JavaScript
1
4
1
:fullscreen{
2
background: black;
3
}
4
Although, this is no success at all. I’m using WebRTC in my project, I don’t think, this is an issue, but just adding incase.
Advertisement
Answer
All it needed was to add
JavaScript
1
2
1
{ navigationUI: "hide" }
2
as the params for the fullscreen request. And I was so dumbfounded by this answer.