← Back to release summary

Replace GamepadList with sequence<Gamepad?> for navigator.getGamepads() return value

Category
Device
Type
No developer-visible change
Status
Enabled by default (Chrome 99)
Intent stage
Shipped

Summary

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().

Standards & signals

View on chromestatus.com