Ready for Trial: GravitySensor API

Skip to first unread message

Mandy, Arnaud

Feb 26, 2021, 11:37:10 AMFeb 26
to Abridged recipients
Contact emails

API spec



Expose the GravitySensor API, which provides a 3-axis reading of the gravity force, to users.

Blink component

Search tags

TAG review

TAG review status

Issues addressed


Interoperability and Compatibility

Generic Sensor APIs, as well as other hardware-related APIs, can be controversial when it comes to interoperability because other browser engine developers have voiced privacy-related concerns. We believe the Chromium implementation addresses those concerns. Additionally, all the data exposed by this API can already be read by users in JavaScript by calculating gravity from the Accelerometer and LinearAccelerometer readings we already provide.

Gecko: Negative Mozilla has not been asked about this specific API, but have raised concerns about the Generic Sensor APIs, including Accelerometer.

WebKit: Negative ( Although Apple has not been specifically asked about this API, they are not part of the Devices & Sensors WG, and have generally been contrary to the Generic Sensor APIs.

Web developers: Positive (

Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?


Yes, except for Mac. The readings are obtained directly from the platform on Android when possible, and implemented as a fusion sensor on top of the Accelerometer implementation otherwise (and in other OSes except for macOS). There is support for gravity sensors in the Linux kernel as well, but we need to write some extra logic to handle falling back to a fusion sensor if they are not present". Per, only older Mac laptops seem to ship with accelerometers. We currently only ship the Accelerometer interface on Macs, but not LinearAccelerometer, in order to support the older Device Orientation/Motion APIs. As such, there does not seem to make much sense to ship this API on Macs either.

Is this feature fully tested by web-platform-tests?


Tracking bug

Link to entry on the Chrome Platform Status

Link to previous Intent discussions

This intent message was generated by Chrome Platform Status.
Reply all
Reply to author
0 new messages