WakeLockSentinel.released

Draft

This page is not complete.

The read-only released property of the WakeLockSentinel interface returns a boolean that indicates whether a WakeLockSentinel has been released yet.

Syntax

var released = sentinel.released;

Value

A Boolean. Its value is false until the WakeLockSentinel has been released (either through a call to WakeLockSentinel.release() or because the lock has been released automatically) and the WakeLockSentinel.onrelease event has been emitted, after which it becomes true and no longer changes.

Examples

This example shows how released's value changes within a WakeLockSentinel's life cycle.

const sentinel = await navigator.wakeLock.request('screen');
console.log(sentinel.released);  // Logs "false"

sentinel.onrelease = () => {
  console.log(sentinel.released);  // Logs "true"
};

await sentinel.release();

Specifications

Specification Status Comment
Unknown
The definition of 'released' in that specification.
Editor's Draft Initial definition.

Browser compatibility

BCD tables only load in the browser