GO-Ve01
ServicesDevelopersBooksDictionaryPapersWikidataEncyclopediaSearchBabelCareersDeck

WakeLockSentinel: release() method

Screen Wake Lock API

Screen Wake Lock API

The **`release()`** method of the WakeLockSentinel interface releases the WakeLockSentinel, returning a Promise that is resolved once the sentinel has been successfully released.

## Syntax

```js-nolint
release()
```

### Parameters

None.

### Return value

Returns a Promise that resolves with `undefined`.

### Exceptions

No exceptions are thrown.
You should always listen for the release event to check if a wake lock has been released.

## Examples

In this example, when a user clicks a button the WakeLockSentinel is released.

```js
wakeLockOffButton.addEventListener("click", () => {
WakeLockSentinel.release();
});
```

## Specifications

## Browser compatibility

## See also

- [Stay awake with the Screen Wake Lock API](https://developer.chrome.com/docs/capabilities/web-apis/wake-lock/)

source: MDN Web Docs mirror · page

Cite this

"WakeLockSentinel: release() method". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/WakeLockSentinel/release

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·