Esc has to always exit fullscreen on the web due to security reasons.
for exports use this scrip to disable default keys like f11 for full screen, esc for exit full screen, f12 for debug, etc.
runOnStartup(async runtime =>
{
// Code to run on the loading screen.
// Note layouts, objects etc. are not yet available.
runtime.addEventListener("beforeprojectstart", () => OnBeforeProjectStart(runtime));
document.addEventListener('keydown', function(event) {
event.preventDefault();
});
});