coderef

Device orientation eventsBaseline · Widely available

The DeviceMotion and DeviceOrientation events report the movement and orientation of the browser's device in physical space. Note that coordinates can differ noticeably between platforms and devices.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Sep 18, 2023. Widely available since Mar 18, 2026.

Browser support

DesktopChrome
1–30Not supported
31+Supportedsince Nov 12, 2013
Current: 155
Edge
12+Supportedsince Jul 29, 2015
Current: 154
Firefox
1–5Not supported
6+Supportedsince Aug 16, 2011
Current: 157
Safari
1–16.6Not supported
17+Supportedsince Sep 18, 2023
Current: 27
MobileChrome Android
18–30Not supported
31+Supportedsince Nov 14, 2013
Current: 155
Firefox Android
4–5Not supported
6+Supportedsince Aug 16, 2011
Current: 157
Safari iOS
1–4Not supported
4.2+Supportedsince Nov 22, 2010
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: DeviceMotionEvent.

Feature detection

JS · check before using
if ("DeviceOrientationEvent" in globalThis) {
  // DeviceOrientationEvent is available
} else {
  // load a polyfill or use a fallback
}

Sub-features

Support for each part of the feature (25). The overall table above shows when the whole feature works.

Show 5 more
Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
DeviceOrientationEvent.gamma7126171864.2
DeviceOrientationEvent.requestPermission_static152152✕✕152✕14.5
Window.devicemotion_event31126173164.2
Window.deviceorientation_event7126171864.2
Window.deviceorientationabsolute_event5079110✕50110✕