2

I'm facing an unexpected behavior and wanted to be sure i'm not missing something before i'm filling a bug.
I've played with requestFullscreen on chrome and firefox and noticed it's not returning a promise like stated in the spec.

Example for webkit:

el.addEventListener('click', () => {
    const p = el.webkitRequestFullScreen();
    p.then(() => {console.log('full screen')});
});

I'm getting:

Uncaught TypeError: Cannot read property 'then' of undefined at HTMLDivElement.el.addEventListener

Same goes for firefox:

el.addEventListener('click', () => {
    const p = el.mozRequestFullScreen();
    p.then(() => {console.log('full screen')});
});

TypeError: p is undefined

Am i reading the spec wrong? shouldn't i expect that promise?

4

1 回答 1

2

https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen#Browser_compatibility

不幸的是,没有浏览器支持返回承诺的版本。

于 2018-08-28T08:22:25.463 回答