I was looking at Solar2D projects on itch.io and noticed that they all suffer from the same problem. After pressing the fullscreen button, the game goes full but black screen until you click and an error appears in the console:
Uncaught (in promise) DOMException: Operation is not supported
request_fullscreen bundle.min.js:1032
enter_fullscreen game.min.js:1
fullscreen_btn game.min.js:1
dispatch bundle.min.js:1395
…
In bundle.min.js:1032 we can see:
request_fullscreen: function (t, e) {
var r,
n,
i;
return r = t.requestFullscreen ? (t.requestFullscreen(), !0) : t.msRequestFullscreen ? (t.msRequestFullscreen(), !0) : t.mozRequestFullScreen ? (t.mozRequestFullScreen(), !0) : t.webkitRequestFullscreen ? (t.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT), !0) : !1,
r &&
e &&
(n = window.screen) != null &&
(i = n.orientation) != null &&
typeof i.lock == 'function' &&
i.lock(e), // line 1032
r
},
i.lock(e) is a call of ScreenOrientation lock().
The documentation states that support for this feature is limited, which is exactly what I encountered using Firefox 140 ESR. Can this be fixed?