Well-deployed technologies
Geolocation
The Geolocation API provides a common interface for locating the device, independently of the underlying technology (GPS, Wi-Fi networks identification, triangulation in cellular networks, etc.).
Camera & Microphone streams
As detailed in the Media part of this document, the Media Capture and Streams API opens up access to camera and microphone streams.
Technologies in progress
Generic sensors
The Generic Sensor API defines a framework for exposing sensor data to the Web platform in a consistent way. In particular, the specification defines a blueprint for writing specifications of concrete sensors along with an abstract Sensor
interface that can be extended to accommodate different sensor types. A number of sensor APIs are being built on top of the Generic Sensor API.
Proximity sensors
The Proximity Sensor specification defines an API to monitor the presence of nearby objects without physical contact.
Ambient light sensors
The Ambient Light Sensor specification defines an API to monitor the ambient light level or illuminance of the device's environment.
Battery status
The Battery Status API exposes information about the battery status of the hosting service (however, note the future of this last specification is uncertain due to identified potential privacy-invasive usage of the API).
Motion sensors
The detection of motion is made possible by a combination of low-level and high-level motion sensor specifications, also built on top of the Generic Sensor API:
- the Accelerometer to obtain information about acceleration applied to the device's local three primary axes;
- the Gyroscope to monitor the rate of rotation around the device's local three primary axes;
- the Magnetometer to measure magnetic field around the device's local three primary axes;
- the Orientation Sensor to monitor the device's physical orientation in relation to a stationary 3D Cartesian coordinate system.
The Motion Sensors Explainer document is an introduction to low-level and high-level motion sensors, their relationship, inner workings and common use-cases.
The DeviceOrientation Event Specification defines several DOM events that provide information about the physical orientation and motion of a hosting device. Most browsers support this specification, but various interoperability issues have arised (which are not well reflected in the implementation info on this page) and work on this specification had been discontinued. Work has now resumed in the Devices and Sensors Working Group to reduce inconsistencies across implementations and finalizing the specification, while the group develops the more powerful Orientation Sensor specification in parallel.
Geolocation
The Geolocation Sensor is an API for obtaining geolocation reading from the hosting device. The feature set of the Geolocation Sensor is similar to that of the Geolocation API, but it is surfaced through the Generic Sensor API, allows continuous geotracking and geofencing (one-time alerts when a user crosses a specific area) operations in the background, improves security and privacy, and is extensible.
Orientation Lock
It is often useful to be able to lock the orientation of the screen; the Screen Orientation API allows not only to detect orientation change, but also to lock the orientation in a specific state.
Exploratory work
NFC
Work on a Web Near-Field Communications (NFC) API to enable wireless communication between two devices at close proximity has started in the Web NFC Community Group.
Bluetooth
Similarly, the Web Bluetooth specification, developed by the Web Bluetooth Community Group, describes an API to discover and communicate with devices over the Bluetooth Low Energy (BLE) mode.
Discontinued features
- Geofencing API
- The ability to detect when a device enters a given geographical area would enable interactions and notifications based on the user's physical presence in a given place. The Geolocation Working Group started to work on a geofencing API to that effect. This work has been discontinued, partly out of struggles to find a good approach to permission needs that such an API triggers to protect users against privacy issues, and because the API depended on the Service Workers, which was not yet stable at the time. Work on this specification could resume in the future depending on interest from would-be implementers.
- Additional sensor specifications
- A number of additional sensor specifications have been considered in the past in the Device sand Sensors Working Group, for instance to expose changes in ambient humidity (proposal which predates the Generic Sensor API), the Barometer Sensor or the Thermometer Sensor. Work on these proposals could resume in the future depending on interest from would-be implementers.