Generic Sensor API browser support
Published
The Generic Sensor API provides interfaces with a shared design for reading device sensors from web pages. Use concrete subclasses such as Accelerometer, Gyroscope, Magnetometer, and AmbientLightSensor; the base Sensor interface is not used directly. Each sensor needs a Permissions API grant under its own permission name (for example accelerometer) and is available only in secure contexts.
The support rows use Accelerometer (api.Accelerometer in MDN browser-compat-data) as the representative interface. Gyroscope matches Accelerometer in that data, while Magnetometer and AmbientLightSensor ship in Chromium only behind the #enable-experimental-web-platform-features flag and are not covered by the rows.
- Legend
- Yes
- Partial
- Flag
- No
- Unknown
| Browser / Platform | Support | Versions | Confidence | Source | Notes |
|---|---|---|---|---|---|
| Chrome (Desktop)# | Yes | 67 | high | source | — |
| Chrome (Android)# | Yes | 67 | high | source | 1 |
| Edge (Desktop)# | Yes | 79 | high | source | 2 |
| Firefox (Desktop)# | No | — | high | source | 3 |
| Firefox (Android)# | No | — | high | source | 45 |
| Safari (macOS)# | No | — | high | source | 6 |
| Safari (iOS)# | No | — | high | source | 78 |
| Samsung Internet# | Yes | 9.0 | high | source | 9 |
| WebView (Android)# | Yes | 67 | high | source | 10 |
- Derived by browser-compat-data mirroring from Chrome.
- Derived by browser-compat-data mirroring from Chrome.
- No Firefox support is recorded in browser-compat-data.
- No Firefox for Android support is recorded in browser-compat-data.
- Derived by browser-compat-data mirroring from Firefox.
- No Safari support is recorded in browser-compat-data.
- No Safari on iOS support is recorded in browser-compat-data.
- Derived by browser-compat-data mirroring from Safari.
- Derived by browser-compat-data mirroring from Chrome Android.
- Derived by browser-compat-data mirroring from Chrome Android.
Cite this table
Generic Sensor API compatibility data — OpenPWA · Verified 2026-10-03 · CC BY 4.0 · JSON
When reusing compatibility data, keep the attribution, identify your changes and check each row’s original source. This citation excludes market-share and reach figures, which use CC BY-SA 4.0.
Errors
Section titled “Errors”The Accelerometer() constructor throws a SecurityError when a Permissions Policy blocks the feature. Once a sensor fires its error event it becomes idle and stops reading values until it is started again (MDN).
See also
Section titled “See also”- Generic Sensor API
- Generic Sensor API (w3c.github.io)
- Sensor APIs (developer.mozilla.org)
- Accelerometer (developer.mozilla.org)