← Back to release summary

Make "type" optional in WakeLock.request()

Category
Capabilities (Fugu)
Type
No developer-visible change
Status
Enabled by default (Chrome 88)
Intent stage
Prepare to ship

Summary

Implement https://github.com/w3c/screen-wake-lock/pull/291, which makes the "type" parameter in WakeLock.request() optional and defaulting to "screen", which is the only allowed value at the moment. In other words, the following two lines would do the exact same thing: navigator.wakeLock.request() navigator.wakeLock.request("screen")

Motivation

This incorporates feedback from the ongoing TAG review. The discussion started in https://github.com/w3c/screen-wake-lock/pull/288, where we were just going to justify why |type| is required, and it turned into a PR to make it optional after all.

Standards & signals

Explainers: https://github.com/w3c/screen-wake-lock/blob/gh-pages/explainer.md

View on chromestatus.com