fscreen icon indicating copy to clipboard operation
fscreen copied to clipboard

return Promise from requestFullscreen()

Open afeld opened this issue 7 years ago • 2 comments

...to match the spec. Thanks!

afeld avatar Dec 13 '18 08:12 afeld

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);

rafgraph avatar Jul 27 '19 13:07 rafgraph

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 😢

betaorbust avatar Aug 12 '19 23:08 betaorbust