The navigator.wakeLock.request("screen") API prevents the device’s screen from dimming or being turned off.
navigator.wakeLock.request("screen")