Make "type" optional in WakeLock.request()

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.

Specification

Editor's draft

Status in Chromium

Blink>WakeLock


Enabled by default (tracking bug) in:

  • Chrome for desktop release 88
  • Chrome for Android release 88
  • Android WebView release 88

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

Owners

Last updated on 2020-10-25