Screen Wake Lock API In JavaScript

Hi There, i'm Said Mounaim A passionate Intermediate Full Stack Developer having an experience of building responsive Web applications with JavaScript / React.js / Next.js / Node.js and some other cool libraries and frameworks.
A browser API to prevent the screen from dimming, sleeping or locking automatically,
This feature is very useful for application like timers, voice based application, live score updates, video players ... etc which don't want the screen to be auto locked.
**Note that there are some cases when the lock is removes automatically **
When the user navigate away from the tab
The user manually locks the screen
let screenLock = await navigator.wakeLock.request('screen');
await lock.release();
**Supported only in Chrome and Edge Currently. **




