Thursday, June 6, 2024
45
rated 0 times [  49] [ 4]  / answers: 1 / hits: 17001  / 6 Years ago, tue, august 28, 2018, 12:00:00

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?


More From » google-chrome

 Answers
21

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



Unfortunately there's no browser support for the promise-returning version.


[#53630] Friday, August 24, 2018, 6 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kristineterrak

Total Points: 74
Total Questions: 109
Total Answers: 115

Location: Anguilla
Member since Sun, Jan 29, 2023
1 Year ago
;