I have been exploring how to add an event listener for fullscreen change in my Next.js app, and I noticed that many example codes use the webkit, moz, and ms prefixes together. However, after testing on Edge, Chrome, and Firefox, it seems that using only the 'fullscreenchange' event works just fine:
document.addEventListener('fullscreenchange', onFullScreenChange);
So, my question is: do we really need to include the other 3 variants as well?
document.addEventListener('mozfullscreenchange', onFullScreenChange);
document.addEventListener('webkitfullscreenchange', onFullScreenChange);
document.addEventListener('msfullscreenchange', onFullScreenChange);
Additionally, I referred to a code snippet from W3Schools, and the result was consistent - using just the 'fullscreenchange' event seemed to work fine.
<!DOCTYPE html>
<html>
... (Code provided for reference)
</html>