The historical migration
The 2017 article by Vishal Mishra described moving from navigator.accelerometer watchers to browser devicemotion events. It contrasted a plugin watcher with event-listener registration and removal, and introduced the event’s acceleration, acceleration-including-gravity and rotation-rate fields.
Read the original article and its examples. This page summarizes the article rather than reproducing it.
Interpreting motion data
The W3C specification defines acceleration and rotation in a device coordinate frame. Acceleration with gravity and linear acceleration are different quantities. It also specifies secure-context and permission requirements; applications must account for unavailable readings and the behavior of their target browser.
The historical plugin’s sampling options and callback lifecycle should not be assumed to map directly onto browser events. Consult the relevant implementation documentation when updating an application.
Related archive
Sources & archive notes
Recovered repository material is attributed to its original authors and distributed with its source license. Changes: FreeSoft layout, archive context, navigation, link and image locations. Apache License 2.0 · Notices and provenance. Editorial material is labeled separately.