We intend to replace GamepadList with sequence<Gamepad?> for the navigator.getGamepads() return value to follow the spec and match current Gecko and WebKit implementations.

Motivation

The W3C Gamepad spec defines the value returned by navigator.getGamepads() as a sequence<Gamepad?>, but Chrome is the only browser to implement it as a GamepadList. It has a similar interface (as it provides an operator[] getter and length attribute) but is not identical as it also provides an .item() accessor. Because of that, web developers tend to use [...navigator.getGamepads()] when they could simply use the Array returned by navigator.getGamepads().

Status in Chromium

Blink>GamepadAPI


Enabled by default (tracking bug)

Consensus & Standardization

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

  • No signal
  • No signal
  • Positive

Owner

Last updated on 2022-04-13