fscreen
fscreen copied to clipboard
return Promise from requestFullscreen()
I think it already does return a promise since it just returns the result from calling requestFullscreen(), which is a promise. Do you have a failing example?
// if this returns a promise
document.body.requestFullscreen();
// then so does this
const fscreenWrapperFunc = (el) => el.requestFullscreen()
fscreenWrapperFunc(document.body);
https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen#Browser_compatibility has a good rundown of which browsers return a promise. It's sort of a warty edge in the browser implementations 😢