I need to know if a player goes to fullscreen mode or back in my HTML5 game. For an example:
document.addEventListener("fullscreenchange", function () { console.log('fullscreen change!'); });
The code above falls with an error message:
Uncaught (in promise) DOMException: Operation is not supported request_fullscreen https://static.itch.io/bundle.min.js?1697477578:1 enter_fullscreen https://static.itch.io/game.min.js?1697477578:1 fullscreen_btn https://static.itch.io/game.min.js?1697477578:1 dispatch https://static.itch.io/bundle.min.js?1697477578:1 dispatch https://static.itch.io/lib.min.js?1697477578:2 handle https://static.itch.io/lib.min.js?1697477578:2