← Back to release summary

DeviceOrientation Events permission request API

Category
Device
Type
New or changed feature
Status
In development (Chrome In development)
Intent stage
Start prototyping

Summary

Allows web developers to call Device{Motion,Orientation}Event.requestPermission() to ask the user agent for device orientation and motion data to be shared with the page. Those two static methods return a promise that resolves to either "granted" or "denied" based on whether the user has allowed the user agent to share sensor data with pages.

Motivation

The new API was added to the Device Orientation spec in https://github.com/w3c/deviceorientation/pull/68 following security concerns raised in https://github.com/w3c/deviceorientation/issues/57.

Standards & signals

Docs: https://docs.google.com/document/d/1zrhTooMd0Pqee8R0dJggDUeAgvt_3na_MaVefPpLG7o/edit?tab=t.0

Explainers: https://www.w3.org/TR/orientation-event/#dom-deviceorientationevent-requestpermission

View on chromestatus.com